]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
detect and accommodate reverse condition for loader strategy
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Mar 2026 18:13:02 +0000 (14:13 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Mar 2026 19:20:53 +0000 (15:20 -0400)
commit3cf6c1112e7aeb6337f68481bf2e631b63f1dd29
tree7dcbad54b81fd431a7e177689b0a276ccf048440
parent38e0fc2dd095e2710ffcc20fd7eccebb2fa25048
detect and accommodate reverse condition for loader strategy

Fixed issue where chained :func:`_orm.joinedload` options would not be
applied correctly when the final relationship in the chain is declared on a
base mapper and accessed through a subclass mapper in a
:func:`_orm.with_polymorphic` query. The path registry now correctly
computes the natural path when a property declared on a base class is
accessed through a path containing a subclass mapper, ensuring the loader
option can be located during query compilation.

Fixes: #13193
Change-Id: I9ec83a0f184caed2bf6dd087b20c3538d6c23597
doc/build/changelog/unreleased_20/13193.rst [new file with mode: 0644]
lib/sqlalchemy/orm/path_registry.py
test/orm/inheritance/test_polymorphic_rel.py
test/orm/inheritance/test_relationship.py