summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2022-09-24 01:00:10 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2022-09-24 01:00:10 +0000
commit8e59de9cc180453470f2530a459ae8c248916288 (patch)
treeeeedfe458681c58e6e0cdfc40927336ebd766ccb /lib/sqlalchemy/sql
parentd50bbd56740f86bb363b405f7d8e5df9667bb4e3 (diff)
parent57b400f07951f0ae8651ca38338ec5be1d222c7e (diff)
downloadsqlalchemy-8e59de9cc180453470f2530a459ae8c248916288.tar.gz
Merge "remove should_nest behavior for contains_eager()" into main
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/elements.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index cfbf24f3c..8167dc7e4 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -4461,7 +4461,7 @@ class Label(roles.LabeledColumnExprRole[_T], NamedColumn[_T]):
# when a label name conflicts with other columns and select()
# is attempting to disambiguate an explicit label, which is not what
# the user would want. See issue #6090.
- if key != self.name:
+ if key != self.name and not isinstance(self.name, _anonymous_label):
raise exc.InvalidRequestError(
"Label name %s is being renamed to an anonymous label due "
"to disambiguation "