]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
remove "deannotate" from column_property expression
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 27 May 2022 20:07:01 +0000 (16:07 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 29 May 2022 20:10:54 +0000 (16:10 -0400)
commit335cdea7c72c279f8cf9de278ac96f7dda2bca15
treec43698d8dee5c0c4b70de2516acfe52476f00187
parent21ae13765d7410228672a282fef29fc0e2b3b098
remove "deannotate" from column_property expression

Fixed issue where using a :func:`_orm.column_property` construct containing
a subquery against an already-mapped column attribute would not correctly
apply ORM-compilation behaviors to the subquery, including that the "IN"
expression added for a single-table inherits expression would fail to be
included.

This fix involves a few tweaks in the ORM adaptation logic,
including a missing "parententity" adaptation on the mapper
side.  The specific mechanics here have a lot of moving parts
so we will continue to add tests to assert these cases.  In
particular a more complete test for issue #2316 is added
that was relying upon the deannotate happening here.

Fixes: #8064
Change-Id: Ia85dd12dcf6e7c002b30de4a27d7aa66cb3cd20e
doc/build/changelog/unreleased_14/8064.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/util.py
test/orm/inheritance/test_single.py
test/orm/test_eager_relations.py
test/orm/test_mapper.py