]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure propagate_to_loaders honored at the sub-loader level
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 9 May 2021 01:21:35 +0000 (21:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 9 May 2021 02:11:53 +0000 (22:11 -0400)
commit7e938c1bc13f894355dafd4abca3566a759b79ad
tree479c472b8f57cc09aba554426507e4aff389e6d2
parent9220bc9d4cd3adc3c03d0b4499bc2ffbdbeee058
Ensure propagate_to_loaders honored at the sub-loader level

Fixed additional regression caused by "eager loaders run on unexpire"
feature :ticket:`1763` where the feature would run for a
``contains_eager()`` eagerload option in the case that the
``contains_eager()`` were chained to an additional eager loader option,
which would then produce an incorrect query as the original query-bound
join criteria were no longer present.

The contains_eager() option correctly included
propagate_to_loaders=False however this would not be considered
if the contains_eager() were chained and therefore bundled inside
of an enclosing loader.  We don't want to turn off propagation
completely in that case because we still want the other
loaders inside to be handled individually, so add a check
as each option is moved into the query context.

Fixes: #6449
Change-Id: Icd1d6611095c20ae44ff5d2df734c24770fc8812
doc/build/changelog/unreleased_14/6449.rst [new file with mode: 0644]
lib/sqlalchemy/orm/strategy_options.py
test/orm/test_expire.py