]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
remove __allow_unmapped__ requirement from dataclasses
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Dec 2022 20:35:39 +0000 (15:35 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 Dec 2022 14:57:36 +0000 (09:57 -0500)
commitf2b36ede482403a1d7631dca4cf7151898472598
treeb883f680c8ebf3e49b8bc1b2a9f1af94348737e5
parentce8c0013169bdbe377ca21389f85051525814264
remove __allow_unmapped__ requirement from dataclasses

Removed the requirement that the ``__allow_unmapped__`` attribute be used
on Declarative Dataclass Mapped class when non-``Mapped[]`` annotations are
detected; previously, an error message that was intended to support legacy
ORM typed mappings would be raised, which additionally did not mention
correct patterns to use with Dataclasses specifically. This error message
is now no longer raised if :meth:`_orm.registry.mapped_as_dataclass` or
:class:`_orm.MappedAsDataclass` is used.

Fixes: #8973
Change-Id: I887afcc2da83dd904444bcb97f31e695b9f8b443
doc/build/changelog/unreleased_20/8973.rst [new file with mode: 0644]
doc/build/orm/dataclasses.rst
lib/sqlalchemy/orm/decl_base.py
test/orm/declarative/test_dc_transforms.py