Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
0.7.4/0.7.5 breaks queries using the `in` operator to test membership of another query result #373
For instance, doing this will fail in 0.7.4 and 0.7.5 (and
foos = Foo.select() Foo.select(lambda x: x in foos)
This is a complete repro:
from pony.orm import * db = Database() class Foo(db.Entity): pass db.bind('sqlite', ':memory:', create_db=True) db.generate_mapping(create_tables=True) with db_session(): foos = Foo.select() Foo.select(lambda x: x in foos) # throws select(foo for foo in Foo if foo in foos) # also throws
and this is the entire traceback:
I am encountering the same issue.
Here is our traceback if it helps:
Should work now!
Previously such conditions were translated as
and column in (?, ?, ?, ..., ?)
Now it translates to:
and column in (select ...)
where previous query is inlined to a new query.
If you want to keep previous behavior, you can force fetching of first query by using