]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add additional support to honor _proxy_key in Core selects
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 5 Jul 2021 18:37:58 +0000 (14:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 5 Jul 2021 19:57:55 +0000 (15:57 -0400)
commit4e1b2ee4cb345f499bdfbff6c393efbebd8e1e72
tree43d550e176570aebdd42c9d1662f1fdee2d0df63
parentb920869ef54d05e73e2a980b73647d6050ffeb9d
Add additional support to honor _proxy_key in Core selects

Fixed ORM regression where ad-hoc label names generated for hybrid
properties and potentially other similar types of ORM-enabled expressions
would usually be propagated outwards through subqueries, allowing the name
to be retained in the final keys of the result set even when selecting from
subqueries. Additional state is now tracked in this case that isn't lost
when a hybrid is selected out of a Core select / subquery.

as we have removed things like column.label() from
ORM, since we now have to export the cols with the same names
as what we will render, experiment with giving a greater role
to the _proxy_key annotation so that a desired name can be
carried through more transarently.

Fixes: #6718
Change-Id: Icb313244c13ea1a8f58d3e05d07aa3e1039e15bf
doc/build/changelog/unreleased_14/6718.rst [new file with mode: 0644]
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/selectable.py
test/ext/test_hybrid.py