]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
allow legacy forms with __allow_unmapped__
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Oct 2022 04:11:10 +0000 (00:11 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Oct 2022 15:48:35 +0000 (11:48 -0400)
commit8370edb4ccca2055635107855b58c795fccbeaf1
tree5f63704726762dbf9b3a1496ce18240a91afd905
parentbfe36f11fb423f2318166162d95941beef3cbaaa
allow legacy forms with __allow_unmapped__

Improved support for legacy 1.4 mappings that use annotations which don't
include ``Mapped[]``, by ensuring the ``__allow_unmapped__`` attribute can
be used to allow such legacy annotations to pass through Annotated
Declarative without raising an error and without being interpreted in an
ORM runtime context. Additionally improved the error message generated when
this condition is detected, and added more documentation for how this
situation should be handled. Unfortunately the 1.4 WARN_SQLALCHEMY_20
migration warning cannot detect this particular configurational issue at
runtime with its current architecture.

Fixes: #8692
Change-Id: I5c642bcc1ebb7816f9470ec9bb0951550b6d55f1
doc/build/changelog/migration_20.rst
doc/build/changelog/unreleased_20/8692.rst [new file with mode: 0644]
doc/build/changelog/whatsnew_20.rst
doc/build/errors.rst
lib/sqlalchemy/orm/decl_base.py
lib/sqlalchemy/orm/util.py
test/orm/declarative/test_dc_transforms.py
test/orm/declarative/test_tm_future_annotations.py
test/orm/declarative/test_typed_mapping.py