^C---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-49-51b1ec4cf2a0> in <module>
2 user_key = ndb.Key(User, 1)
3 query = User.query(User.key == user_key)
----> 4 results = query.map(test_func)
5
6
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/query.py in wrapper(self, *args, **kwargs)
1204 query_options = QueryOptions(client=client, **query_arguments)
1205
-> 1206 return wrapped(self, *dummy_args, _options=query_options)
1207
1208 return wrapper
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/query.py in map(self, callback, keys_only, limit, projection, offset, batch_size, prefetch_size, produce_cursors, start_cursor, end_cursor, timeout, deadline, read_consistency, read_policy, transaction, options, pass_batch_into_callback, merge_future, _options)
1953 returned, map() returns a list of the results of all callbacks.
1954 """
-> 1955 return self.map_async(None, _options=_options).result()
1956
1957 @tasklets.tasklet
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py in result(self)
189 Any: The result
190 """
--> 191 self.check_success()
192 return self._result
193
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py in check_success(self)
133 the future's exception, if there is one, or else do nothing.
134 """
--> 135 self.wait()
136
137 if self._exception:
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py in wait(self)
125 """
126 while not self._done:
--> 127 _eventloop.run1()
128
129 def check_success(self):
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/_eventloop.py in run1()
408 def run1():
409 """Calls :method:`EventLoop.run1` on current event loop."""
--> 410 loop = get_event_loop()
411 loop.run1()
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/_eventloop.py in get_event_loop()
366 EventLoop: The event loop for the current context.
367 """
--> 368 context = context_module.get_context()
369 return context.eventloop
370
~/Projects/sandboxx/py_37/lib/python3.7/site-packages/google/cloud/ndb/context.py in get_context(raise_context_error)
66 ``raise_context_error`` is :data:`True`.
67 """
---> 68 context = _state.context
69 if context:
70 return context
KeyboardInterrupt:
Code example
works when the query.fetch() would return results
does not work when query.fetch() would return an empty list
fails to print or return
First experienced this with my flask app timing out
tried in the interpreter and got the same results
stacktrace from the
KeyboardInterrupt