]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
restore graceful degrade of subqueryload w from_statement
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Dec 2021 16:25:00 +0000 (11:25 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 26 Dec 2021 19:45:45 +0000 (14:45 -0500)
commit818d62be00530549aa52dd5d981819010e4ae484
treefdbb5a8290fcb36a3ae4661c083c3d9716fb6ee0
parent79e047806261e8d6690b0d8dacd641eba6d6e3ec
restore graceful degrade of subqueryload w from_statement

Fixed regression from 1.3 where the "subqueryload" loader strategy would
fail with a stack trace if used against a query that made use of
:meth:`_orm.Query.from_statement` or :meth:`_sql.Select.from_statement`. As
subqueryload requires modifying the original statement, it's not compatible
with the "from_statement" use case, especially for statements made against
the :func:`_sql.text` construct. The behavior now is equivalent to that of
1.3 and previously, which is that the loader strategy silently degrades to
not be used for such statements, typically falling back to using the
lazyload strategy.

Fixes: #7505
Change-Id: I950800dc86a77f8320a5e696edce1ff2c84b1eb9
doc/build/changelog/unreleased_14/7505.rst [new file with mode: 0644]
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/strategies.py
test/orm/test_eager_relations.py
test/orm/test_query.py
test/orm/test_selectin_relations.py
test/orm/test_subquery_relations.py