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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for using the emulator programatically #87
Conversation
google/cloud/spanner_v1/client.py
Outdated
else: | ||
self._client_options = client_options | ||
|
||
if isinstance(credentials, AnonymousCredentials): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for other libraries, we may have done the opposite.
If the emulator_env_variable is set, we hard-code anonymous/null credentials for the emulator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated it to set AnonymousCredentials when the env var is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Currently, we do not support setting the emulator host outside of the env flag
SPANNER_EMULATOR_HOST
.This PR allows users to set the emulator host by using the
api_endpoint
inclient_options
withgoogle.auth.credentials.AnonymousCredentials
e.g.