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_1_0b1~98^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a20d277c52bae6863512c90c64fba2e451950e3;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 (cherry picked from commit 785224a92f39bd5bdd05bbc66f4dd79736abded5) --- diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 67a442b0c2..8256900f96 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -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