]> 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:49 +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

(cherry picked from commit 785224a92f39bd5bdd05bbc66f4dd79736abded5)

lib/sqlalchemy/sql/elements.py

index 67a442b0c2aa0bfb4f576013c4429d2143df2d59..8256900f960044f7d867baf5ac8e3d4e85c6070d 100644 (file)
@@ -4005,8 +4005,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