Conversation
8d4d7d5 to
e87f8c7
Compare
|
Hi, thank you for bringing this to our attention! I've created issue #353 and proposed my own fix with #354 . These address the first issue you brought up. As far as the second issue, I really wouldn't expect it to work the way you describe. I think it's perfectly reasonable to expect the arguments of the |
|
Hi Chris, thank you so much for the response and the PR!! In relation to the multiple yields, my apologies for the bad example. Here is the some actual code in our codebase (that currently works when (all_projects, all_shared) = yield \
ndb.get_multi_async(keys=[Project(id=project_id, parent=account.key).key for project_id in project_ids]), \
[lookup_by_project_id_async(account, project_id) for project_id in project_ids]I don't think your solution to concat the lists would work here since I definitely agree that my (recursive) solution was kind of lame in that it handled arbitrarily nested lists/tuples, which there is probably no legitimate use case for. Nonetheless I was hoping we would be able to achieve backwards compatibility? |
This adds backwards compatibility with the legacy code. Fixes googleapis#349.
|
brilliant!! thank you so much. these PRs fix both of my issues. |
This adds backwards compatibility with the legacy code. Fixes #349.
This fixes an issue we've found in the process of migrating our backend codebase from appengine ndb to python ndb: Tasklet yields on empty tuples/lists do not work.
Say you have code that looks like:
This doesn't work if
blahs == []. NDB hangs indefinitely because there are no futures to finish and tell the event loop to stop.This issue also affects yields on multiple expressions. Something like this fails too (when
blahs == []):This latter example does not hang indefinitely but crashes immediately on this line: