summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-11-14 13:18:45 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-11-14 13:43:02 -0500
commitbf6adda95461d4c3c2076d39850df2403a157662 (patch)
treedc4f6249aa96b85dfb6bcb9626c75b27bbd98dc1 /lib/sqlalchemy/sql/elements.py
parent3d892381996e7ba68ee3bf6d7de40c8414e3812a (diff)
downloadsqlalchemy-bf6adda95461d4c3c2076d39850df2403a157662.tar.gz
avoid putting annotated columns in sets
backporting a small bit of the changes made for the 2.0 version of #8796. See if the changes apply cleanly to the 1.4 branch. Fixes: #8796 Change-Id: I8118511a10beb38c545a55c962a18a77611293af
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 72486e749..d438e5995 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -902,21 +902,21 @@ class ColumnElement(
@util.memoized_property
def proxy_set(self):
- s = util.column_set([self])
+ s = util.column_set([self._deannotate()])
for c in self._proxies:
s.update(c.proxy_set)
return s
- def _uncached_proxy_set(self):
+ def _uncached_proxy_list(self):
"""An 'uncached' version of proxy set.
This is so that we can read annotations from the list of columns
without breaking the caching of the above proxy_set.
"""
- s = util.column_set([self])
+ s = [self]
for c in self._proxies:
- s.update(c._uncached_proxy_set())
+ s.extend(c._uncached_proxy_list())
return s
def shares_lineage(self, othercolumn):