fix: Preemptively fix API change in NDB. #7361
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Glockenspiel broke due to 'query' now being required within a client context. This change fixed Glockenspiel. Blockly samples doesn't appear to be broken yet, but Glockenspiel broke at midnight yesterday.
Similar change being made to Blockly Games.
google.cloud.ndb.exceptions.ContextError
No current context. NDB calls must be made in context established by google.cloud.ndb.Client.context.
Traceback (most recent call last): File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 271, in handle keepalive = self.handle_request(req, conn) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/gunicorn/workers/gthread.py", line 323, in handle_request respiter = self.wsgi(environ, resp.start_response) File "/srv/main.py", line 42, in app return storage.app(environ, start_response) File "/srv/storage.py", line 89, in app out = xmlToKey(forms["xml"].value) File "/srv/storage.py", line 47, in xmlToKey lookup_query = Xml.query(Xml.xml_hash == xml_hash) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/ndb/utils.py", line 118, in wrapper return wrapped(*args, **new_kwargs) File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/ndb/model.py", line 5545, in _query default_options=kwargs["default_options"], File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/ndb/query.py", line 1384, in init database = context_module.get_context().client.database or None File "/layers/google.python.pip/pip/lib/python3.7/site-packages/google/cloud/ndb/context.py", line 118, in get_context raise exceptions.ContextError() google.cloud.ndb.exceptions.ContextError: No current context. NDB calls must be made in context established by google.cloud.ndb.Client.context.