summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-02-26 00:20:39 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-02-26 00:20:39 -0500
commit0210695bd97e76f58d8781b69337816501482fb0 (patch)
tree8d86db3143a258142c92ad7820f62a61a24409e2 /lib/sqlalchemy/sql/elements.py
parentf8914288f012c4ef635531f09a0e13bcacacdb2a (diff)
downloadsqlalchemy-0210695bd97e76f58d8781b69337816501482fb0.tar.gz
- Anonymous labeling is applied to a :attr:`.func` construct that is
passed to :func:`.column_property`, so that if the same attribute is referred to as a column expression twice the names are de-duped, thus avoiding "ambiguous column" errors. Previously, the ``.label(None)`` would need to be applied in order for the name to be de-anonymized. fixes #3663
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-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 ca822d310..67a442b0c 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -4006,7 +4006,7 @@ def _cloned_difference(a, b):
def _labeled(element):
- if not hasattr(element, 'name'):
+ if not hasattr(element, 'name') or not getattr(element, '_label', None):
return element.label(None)
else:
return element