can't use in_(someselect) as a column expression in another select

Issue #1074 resolved
Mike Bayer repo owner created an issue
from sqlalchemy import *

from sqlalchemy.sql import table, column

t1 = table('t1', column('c1'))

col = t1.c.c1.in_(select([t1.c.c1](t1.c.c1)))
sel = select([col](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.

Comments (2)

  1. Log in to comment