Skip to content

Commit

Permalink
fix: pass gRPC config options to gRPC channel creation (#26)
Browse files Browse the repository at this point in the history
* fix: pass gRPC config options to grpc channel creation

* regen spanner_grpc_transport.py to include changes (via synth)

Co-authored-by: larkee <larkee@users.noreply.github.com>
  • Loading branch information
larkee and larkee committed Apr 17, 2020
1 parent 0f526bf commit 6c9a1ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -107,6 +107,9 @@ def create_channel(
pkg_resources.resource_string(__name__, _SPANNER_GRPC_CONFIG)
)
options = [(grpc_gcp.API_CONFIG_CHANNEL_ARG, grpc_gcp_config)]
if "options" in kwargs:
options.extend(kwargs["options"])
kwargs["options"] = options
return google.api_core.grpc_helpers.create_channel(
address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs
)
Expand Down
3 changes: 3 additions & 0 deletions synth.py
Expand Up @@ -62,6 +62,9 @@
"\g<1>grpc_gcp_config = grpc_gcp.api_config_from_text_pb("
"\g<1> pkg_resources.resource_string(__name__, _SPANNER_GRPC_CONFIG))"
"\g<1>options = [(grpc_gcp.API_CONFIG_CHANNEL_ARG, grpc_gcp_config)]"
"\g<1>if 'options' in kwargs:"
"\g<1> options.extend(kwargs['options'])"
"\g<1>kwargs['options'] = options"
"\g<0>",
)
s.replace(
Expand Down

0 comments on commit 6c9a1ba

Please sign in to comment.