[Sqlalchemy-tickets] [sqlalchemy] #1074: can't use in_(someselect) as a column expression in anothe
Brought to you by:
zzzeek
From: sqlalchemy <mi...@zz...> - 2008-06-12 14:26:48
|
#1074: can't use in_(someselect) as a column expression in another select --------------------+------------------------------------------------------- Reporter: zzzeek | Owner: zzzeek Type: defect | Status: new Priority: high | Milestone: 0.4.xx Component: sql | Severity: minor - half an hour Keywords: | Status_field: in queue --------------------+------------------------------------------------------- {{{ from sqlalchemy import * from sqlalchemy.sql import table, column t1 = table('t1', column('c1')) col = t1.c.c1.in_(select([t1.c.c1])) sel = select([col]) print sel }}} the from list of the embedded select gets exported. If you call as_scalar() on it explicitly, you get a warning and then two levels of parens. The in_() should handle calling as_scalar() on the embedded select in all cases to prevent FROM exporting and fix the double parens. -- Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1074> sqlalchemy <http://www.sqlalchemy.org/> The Database Toolkit for Python |