Skip to content

Commit

Permalink
fix: Adding credentials as parameter for Spanner (#1031)
Browse files Browse the repository at this point in the history
* fix: Adding credentials as parameter for Service Account key

* fix: linting fix

---------

Co-authored-by: Piyush Sarraf <[email protected]>
  • Loading branch information
piyushsarraf and Piyush Sarraf committed Nov 3, 2023
1 parent 8c76c1b commit 367658e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion third_party/ibis/ibis_cloud_spanner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ def do_connect(
instance_id: str,
database_id: str = None,
project_id: str = None,
credentials=None,
) -> None:

self.spanner_client = spanner.Client(project=project_id)
self.spanner_client = spanner.Client(
project=project_id, credentials=credentials
)
self.instance = self.spanner_client.instance(instance_id)
self.database_name = self.instance.database(database_id)
(
Expand Down
2 changes: 2 additions & 0 deletions third_party/ibis/ibis_cloud_spanner/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def spanner_connect(
instance_id,
database_id,
project_id=None,
credentials=None,
):
"""Create a Cloud Spanner Backend for use with Ibis.
Expand All @@ -38,5 +39,6 @@ def spanner_connect(
instance_id=instance_id,
database_id=database_id,
project_id=project_id,
credentials=credentials,
)
return backend

0 comments on commit 367658e

Please sign in to comment.