From: Mike Bayer Date: Fri, 26 Feb 2016 16:27:12 +0000 (-0500) Subject: - unfortunately calling upon "_label" here makes it unclear if X-Git-Tag: rel_1_0_13~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=785224a92f39bd5bdd05bbc66f4dd79736abded5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - unfortunately calling upon "_label" here makes it unclear if we're trying to hit columns without names yet and such, to suit the bug right now just make it specific to FunctionElement --- diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 3c5311d185..0470edfbae 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -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