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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse explicit credentials when creating 'database.spanner_api'. #3722

Merged
merged 3 commits into from
Aug 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use 'with_scopes_if_required' to accomodate scopeless creds.
Addresses:
#3722 (comment)
  • Loading branch information
tseaver committed Aug 3, 2017
commit f2cdf6dde2200a3c63d5e6af643c3c43a60c5853
3 changes: 2 additions & 1 deletion spanner/google/cloud/spanner/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def spanner_api(self):
"""Helper for session-related API calls."""
if self._spanner_api is None:
base_creds = self._instance._client.credentials
scoped = base_creds.with_scopes((SPANNER_DATA_SCOPE,))
scoped = google.auth.credentials.with_scopes_if_required(
base_creds, (SPANNER_DATA_SCOPE,))
self._spanner_api = SpannerClient(
lib_name='gccl',
lib_version=__version__,
Expand Down