FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Moving datastore GAX/gRPC helpers out of _http and into dedicated module. by dhermes · Pull Request #3036 · googleapis/google-cloud-python · GitHub

Moving datastore GAX/gRPC helpers out of _http and into dedicated module. - #3036

Merged
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:give-datastore-gax
Feb 22, 2017
Merged

Moving datastore GAX/gRPC helpers out of _http and into dedicated module.#3036
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:give-datastore-gax

Conversation

dhermes commented Feb 17, 2017

Copy link
Copy Markdown
Contributor

This leaves _http.py closer to what it should look like, but not all the way there (it is doing some of the transport choosing that should be done in client.py)

dhermes added api: datastore Issues related to the Datastore API. hygiene labels Feb 17, 2017
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 17, 2017
@@ -0,0 +1,197 @@
# Copyright 2014 Google Inc.

This comment was marked as spam.

This comment was marked as spam.


@contextlib.contextmanager
def _grpc_catch_rendezvous():
"""Re-map gRPC exceptions that happen in context.

This comment was marked as spam.

This comment was marked as spam.

dhermes commented Feb 17, 2017

Copy link
Copy Markdown
Contributor Author

@daspecster I folded those changes into the original commit (since they were super tiny)

Copy link
Copy Markdown
Contributor

SGTM! Thanks! I know they were nitpicky.

The rest LGTM but I feel like someone else should take a crack at it.

try:
from grpc import StatusCode
from google.cloud.grpc.datastore.v1 import datastore_pb2_grpc
from google.cloud.datastore._gax import _DatastoreAPIOverGRPC

This comment was marked as spam.

This comment was marked as spam.

from grpc import StatusCode
from google.cloud.grpc.datastore.v1 import datastore_pb2_grpc
from google.cloud.datastore._gax import _DatastoreAPIOverGRPC
_HAVE_GRPC = True

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

yield
except exceptions.GrpcRendezvous as exc:
error_code = exc.code()
error_class = _GRPC_ERROR_MAPPING.get(error_code)

This comment was marked as spam.

This comment was marked as spam.

from grpc import StatusCode
from google.cloud.grpc.datastore.v1 import datastore_pb2_grpc
from google.cloud.datastore._gax import _DatastoreAPIOverGRPC
_HAVE_GRPC = True

This comment was marked as spam.

dhermes merged commit 0cb9e53 into googleapis:master Feb 22, 2017
dhermes deleted the give-datastore-gax branch February 22, 2017 00:48
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
Moving datastore GAX/gRPC helpers out of _http and into dedicated module.
parthea pushed a commit that referenced this pull request Nov 24, 2025
Moving datastore GAX/gRPC helpers out of _http and into dedicated module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL