]> 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)
committerMichael Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Mar 2026 19:21:17 +0000 (19:21 +0000)
commitaaaff59df9ab3773843c0cbf74c8a617cc5ac877
treeff0cc8b0a41b990015b4336ef396b3e654ccde84
parent77330eb79a36ad221e17352d1b7a72e771dde621
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
(cherry picked from commit 5f7e29fb4657367d8b02bd5d56ad28807b9df691)
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