diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-01 20:15:33 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-09-01 20:15:33 -0400 |
commit | 9070e5c2a5e43c32788be316182cd2017d830012 (patch) | |
tree | a1ce115c1943de90c6fde2507e74c1aa80deb3a3 /lib/sqlalchemy/sql/compiler.py | |
parent | 51f1fdf3e40065e349310a6ba9a49306b9648160 (diff) | |
download | sqlalchemy-9070e5c2a5e43c32788be316182cd2017d830012.tar.gz |
- repair type expressions for columns when we aren't using select.apply_labels(),
label should be the column name.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 297cd9adb..2fc14c84c 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1038,7 +1038,11 @@ class SQLCompiler(engine.Compiled): isinstance(column, sql.Function)): result_expr = _CompileLabel(col_expr, column.anon_label) elif col_expr is not column: - result_expr = _CompileLabel(col_expr, column.anon_label) + # TODO: are we sure "column" has a .name and .key here ? + # assert isinstance(column, sql.ColumnClause) + result_expr = _CompileLabel(col_expr, + sql._as_truncated(column.name), + alt_names=(column.key,)) else: result_expr = col_expr @@ -1067,7 +1071,6 @@ class SQLCompiler(engine.Compiled): iswrapper=False, fromhints=None, compound_index=0, positional_names=None, **kwargs): - entry = self.stack and self.stack[-1] or {} existingfroms = entry.get('from', None) |