Hi all,

Please take a look at this parallel tasklet code snippet #1.


@ndb.tasklet
def get_data_parallel(e):
usr, det = yield (e.user.get_async(),
                  MyKind.query(ancestor = e.key).fetch_async())
raise ndb.Return((e, usr, det))



If e.user is None this raise an Exception.


I'm trying this snippet #2. However I still get Exception: "TypeError:
Expected Future, received <type 'NoneType'>: None"


@ndb.tasklet
def get_data_parallel(e):
  usr, det = yield (e.user.get_async() if e.user else None,
                    MyKind.query(ancestor = e.key).fetch_async())
  raise ndb.Return((e, usr, det))


How can I do something like snippet #2 ? How can I return future(None) or
future('')

Thanks and regards
Moisés Belchín.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to