Connection management support (with optional grpc_gcp dependency)#5553
Conversation
| are passed to :func:`google.auth.default`. | ||
| kwargs: Additional key-word args passed to | ||
| :func:`google.auth.transport.grpc.secure_authorized_channel`. | ||
| :func:`_create_secure_channel`. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return _wrap_unary_errors(callable_) | ||
|
|
||
|
|
||
| def _create_secure_channel( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| options = None | ||
|
|
||
| if HAS_GRPC_GCP: | ||
| # Initialize grpc gcp config for spanner api. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
… channel config, add system tests with grpc_gcp
|
Hi @theacodes , I have made some changes as requested. Please take a look, thanks! |
theacodes
left a comment
There was a problem hiding this comment.
Looking almost ready. Sorry for the delay on reviewing.
| def create_channel(target, | ||
| credentials=None, | ||
| scopes=None, | ||
| ssl_credentials=None, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| options = None | ||
|
|
||
| if HAS_GRPC_GCP: | ||
| # Initialize grpc gcp config for spanner api. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Hi @theacodes , can you take a look at the new changes? |
| return_value=(mock.sentinel.credentials, mock.sentinel.projet)) | ||
| @mock.patch('google.auth.transport.grpc.secure_authorized_channel') | ||
| def test_create_channel_implicit(secure_authorized_channel, default): | ||
| @mock.patch('grpc._channel.Channel') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…onal grpc_gcp dependency) (#5553)
…onal grpc_gcp dependency) (#5553)
Add optional grpc_gcp dependency for api_core and spanner_v1. If user has installed grpcio-gcp, then the connection management feature will be enabled, and with the configuration specified in spanner.grpc.config . Otherwise, grpc_gcp won't be imported and everything works as usual.