- changed status to resolved
confusing error message for in_
Issue #715
resolved
>>> list(session.query(Broker).filter(Broker.id.in_([1](1))))
<class 'sqlalchemy.exceptions.SQLError'>: (ProgrammingError) You cannot execute SELECT statements in executemany(). u'SELECT brokers.id AS brokers_id, brokers.name AS brokers_name \nFROM brokers \nWHERE brokers.id = ? ORDER BY brokers.oid' [[1]([1)]
Really it would be nice if in_() just took a list instead of always having to unpack the_list you're using. (Or took a list as an alterative to args.) I almost never have occasion to use in_(1, 2, 3) outside of tests.
Comments (1)
-
reporter - Log in to comment
from ticket
#750This should be much more rare now. Not sure how much more inspection could be done, e.g.
in_([[1]([1),[2](2)])
. The inner lists could be a perfectly valid type such as PGArray.