ShardedQuery closes result too early
Issue #1228
resolved
ShardedQuery._execute_and_instances creates an iterator around the result that is returned. However. In a try/finally around that return it also closes the result, causing a subsequent result.fetchall() to fail.
For me, removing the try/finally did the trick, I don't know what that breaks, though.
Comments (2)
-
repo owner -
repo owner - changed status to resolved
OK I actually have fixed
#1099and it was just that the signature ofquery.instances()
had changed but shard.py did not, so I see what you mean by the fetchall() call...you mean thefetchall()
within instances (that was not clear to me). fetchall() closes the result in any case so this is 181424b743ba59ec2b6631b4d914df136757d2fd . - Log in to comment
to ensure I'm not insane, you're calling
query.yield_per(x)
? otherwisequery.instances()
fully consumes the result set. calling fetchall() should return no rows unless you used the yield-per option.