]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
dont assume copy_with() on builtins list, dict, etc; improve error msg.
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 16 Jan 2023 15:31:39 +0000 (10:31 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 16 Jan 2023 19:23:49 +0000 (14:23 -0500)
commit046272e06aa3284a87e0dd1f90d2242fb434de10
tree8a6ea002b34241c4b24355107361aef8590472bc
parent6da2f72b1144738ddae23e7fd882a8cd79ea1c60
dont assume copy_with() on builtins list, dict, etc; improve error msg.

Fixed issue where using an ``Annotated`` type in the
``type_annotation_map`` which itself contained a plain container type (e.g.
``list``, ``dict``) generic type as the target type would produce an
internal error where the ORM were trying to interpret the ``Annotated``
instance.

Added an error message when a :func:`_orm.relationship` is mapped against
an abstract container type, such as ``Mapped[Sequence[B]]``, without
providing the :paramref:`_orm.relationship.container_class` parameter which
is necessary when the type is abstract. Previously the the abstract
container would attempt to be instantiated and fail.

Fixes: #9099
Fixes: #9100
Change-Id: I18aa6abd5451c5ac75a9caed8441ff0cd8f44589
doc/build/changelog/unreleased_20/9099.rst [new file with mode: 0644]
doc/build/changelog/unreleased_20/9100.rst [new file with mode: 0644]
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/util/typing.py
test/orm/declarative/test_tm_future_annotations_sync.py
test/orm/declarative/test_typed_mapping.py