From e55ca07561f9c946276f3bde599e69947769f560 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 12 Aug 2020 16:00:07 -0400 Subject: [PATCH] feat: pass 'client_options' to base class ctor (#104) Closes #69. --- google/cloud/bigtable/client.py | 4 +++- setup.py | 2 +- tests/unit/test_client.py | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/google/cloud/bigtable/client.py b/google/cloud/bigtable/client.py index 935a0a3b6..bbb830519 100644 --- a/google/cloud/bigtable/client.py +++ b/google/cloud/bigtable/client.py @@ -174,7 +174,9 @@ def __init__( self._admin_client_options = admin_client_options self._channel = channel self.SCOPE = self._get_scopes() - super(Client, self).__init__(project=project, credentials=credentials) + super(Client, self).__init__( + project=project, credentials=credentials, client_options=client_options, + ) def _get_scopes(self): """Get the scopes corresponding to admin / read-only state. diff --git a/setup.py b/setup.py index a8f544560..ece5050d5 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ release_status = 'Development Status :: 5 - Production/Stable' dependencies = [ "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - "google-cloud-core >= 1.0.3, < 2.0dev", + "google-cloud-core >= 1.4.1, < 2.0dev", "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", ] extras = { diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 8a2ef3c64..204e1a5c1 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -231,8 +231,10 @@ def test_table_data_client_not_initialized_w_client_info(self): self.assertIs(client._table_data_client, table_data_client) def test_table_data_client_not_initialized_w_client_options(self): + from google.api_core.client_options import ClientOptions + credentials = _make_credentials() - client_options = mock.Mock() + client_options = ClientOptions(quota_project_id="QUOTA-PROJECT") client = self._make_one( project=self.PROJECT, credentials=credentials, client_options=client_options )