]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Don't apply no-traverse to query.statement
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 14 Jul 2018 16:26:29 +0000 (12:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 14 Jul 2018 17:11:53 +0000 (13:11 -0400)
commitfb377229cd4c4e503bde9c44b78d30ad48f3cf7e
tree028747fa14cfc3eefc4003744e371c5e809626f8
parenta5d4653b6e26420a61be6e80fef8a0645cb64ceb
Don't apply no-traverse to query.statement

Fixed long-standing issue in :class:`.Query` where a scalar subquery such
as produced by :meth:`.Query.exists`, :meth:`.Query.as_scalar` and other
derivations from :attr:`.Query.statement` would not correctly be adapted
when used in a new :class:`.Query` that required entity adaptation, such as
when the query were turned into a union, or a from_self(), etc. The change
removes the "no adaptation" annotation from the :func:`.select` object
produced by the :attr:`.Query.statement` accessor.

Change-Id: I554e0e909ac6ee785ec3b3b14aaec9d235aa28cf
Fixes: #4304
doc/build/changelog/unreleased_13/4304.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
test/orm/inheritance/test_polymorphic_rel.py
test/orm/test_froms.py