]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
ensure intermediary mappers emit subclass IN
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 27 Apr 2024 04:31:07 +0000 (00:31 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 27 Apr 2024 18:07:30 +0000 (14:07 -0400)
commit37c598a41efd2609622b1ca6ee698dbe0ab5ac8b
tree10ad26a407f2d313a11ef7c6275015cdb8005217
parent046ebffed77aff2f5e039763af4a3eb8a122c9c8
ensure intermediary mappers emit subclass IN

Fixed issue in :func:`_orm.selectin_polymorhpic` loader option where the
SELECT emitted would only accommodate for the child-most class among the
result rows that were returned, leading intermediary-class attributes to be
unloaded if there were no concrete instances of that intermediary-class
present in the result.   This issue only presented itself for multi-level
inheritance hierarchies.

Fixes: #11327
Change-Id: Iec88cc517613d031221a1c035c4cfb46db0154be
doc/build/changelog/unreleased_20/11327.rst [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
test/orm/inheritance/test_poly_loading.py