]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
set _render_for_subquery for legacy set ops
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 25 Jun 2021 20:10:01 +0000 (16:10 -0400)
committermike bayer <mike_mp@zzzcomputing.com>
Sat, 26 Jun 2021 19:08:04 +0000 (19:08 +0000)
commit77e58046dc9222a4a869443cf30bc9ff39312f9d
treeea16beecd5222f509342259b63d076d1699c6700
parent84a68ac8820a2e1043f8317d42c5681c81cbd9d5
set _render_for_subquery for legacy set ops

Adjusted :meth:`_orm.Query.union` and similar set operations to be
correctly compatible with the new capabilities just added in
:ticket:`6661`, with SQLAlchemy 1.4.19, such that the SELECT statements
rendered as elements of the UNION or other set operation will include
directly mapped columns that are mapped as deferred; this both fixes a
regression involving unions with multiple levels of nesting that would
produce a column mismatch, and also allows the :func:`_orm.undefer` option
to be used at the top level of such a :class:`_orm.Query` without having to
apply the option to each of the elements within the UNION.

Fixes: #6678
Change-Id: Iba97ce7fd8a965499853256fd2eb7f61512db60f
doc/build/changelog/unreleased_14/6678.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
test/orm/test_core_compilation.py
test/orm/test_query.py