Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(firestore): add client_options to base class #148

Merged
merged 2 commits into from Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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