]> 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 19:56:59 +0000 (15:56 -0400)
commite247b3450945a46eff1a0c96de8d46384ac1d644
tree52dc96adcf905ce5137341e96cecd3c6c7c1d1b2
parent9d5ae6b9f642d0c2f7843a866019e6733afc2767
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
(cherry picked from commit 8c5cc8ae255a7580e2ff339659cf66cd2c6e02c1)
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
lib/sqlalchemy/testing/fixtures.py
test/orm/inheritance/test_single.py
test/orm/test_eager_relations.py
test/orm/test_mapper.py