Skip to content

Commit

Permalink
add require scope and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal committed Feb 6, 2025
1 parent 5fff1c9 commit 465fcc0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ibis-server/app/model/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ def query(self, sql: str, limit: int) -> pd.DataFrame:
credentials = service_account.Credentials.from_service_account_info(
credits_json
)
credentials = credentials.with_scopes(
[
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/cloud-platform",
]
)
client = bigquery.Client(credentials=credentials)
ibis_schema_mapper = ibis.backends.bigquery.BigQuerySchema()
bq_fields = client.query(sql).result()
Expand Down
10 changes: 6 additions & 4 deletions ibis-server/app/model/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ def get_bigquery_connection(info: BigQueryConnectionInfo) -> BaseBackend:
credentials = service_account.Credentials.from_service_account_info(
credits_json
)
credentials = credentials.with_scopes([
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/cloud-platform",
])
credentials = credentials.with_scopes(
[
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/cloud-platform",
]
)
return ibis.bigquery.connect(
project_id=info.project_id.get_secret_value(),
dataset_id=info.dataset_id.get_secret_value(),
Expand Down

0 comments on commit 465fcc0

Please sign in to comment.