]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- unfortunately calling upon "_label" here makes it unclear if
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 26 Feb 2016 16:27:12 +0000 (11:27 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 26 Feb 2016 16:27:12 +0000 (11:27 -0500)
we're trying to hit columns without names yet and such, to suit the bug
right now just make it specific to FunctionElement

lib/sqlalchemy/sql/elements.py

index 3c5311d18523f2d1172a983d2dccc42064fbad5b..0470edfbae9d2c1156077438a4fee75a4868ab23 100644 (file)
@@ -3687,8 +3687,10 @@ def _cloned_difference(a, b):
                if not all_overlap.intersection(elem._cloned_set))
 
 
-def _labeled(element):
-    if not hasattr(element, 'name') or not getattr(element, '_label', None):
+@util.dependencies("sqlalchemy.sql.functions")
+def _labeled(functions, element):
+    if not hasattr(element, 'name') or \
+            isinstance(element, functions.FunctionElement):
         return element.label(None)
     else:
         return element