Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(firestore): add client_options to base class (#148)
* feat(firestore): add client_options to base class

* chore: bump g-c-c to 1.4.1

Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>

Co-authored-by: Tres Seaver <tseaver@palladion.com>
Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 13, 2020
1 parent 4471923 commit 91d6580
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion google/cloud/firestore_v1/client.py
Expand Up @@ -107,7 +107,10 @@ def __init__(
# will have no impact since the _http() @property only lazily
# creates a working HTTP object.
super(Client, self).__init__(
project=project, credentials=credentials, _http=None
project=project,
credentials=credentials,
client_options=client_options,
_http=None,
)
self._client_info = client_info
if client_options:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -26,7 +26,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",
"pytz",
]
extras = {}
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/v1/test_client.py
Expand Up @@ -61,10 +61,12 @@ def test_constructor_with_emulator_host(self):
getenv.assert_called_once_with(_FIRESTORE_EMULATOR_HOST)

def test_constructor_explicit(self):
from google.api_core.client_options import ClientOptions

credentials = _make_credentials()
database = "now-db"
client_info = mock.Mock()
client_options = mock.Mock()
client_options = ClientOptions("endpoint")
client = self._make_one(
project=self.PROJECT,
credentials=credentials,
Expand Down

0 comments on commit 91d6580

Please sign in to comment.