Skip to content

Commit

Permalink
fix: Fixed BigQuery datasets that have colon in URI (#855)
Browse files Browse the repository at this point in the history
* fix: Fixed BigQuery datasets that have colon in URI

The colon-based "project:dataset.table" format is no longer supported.

Fixes: #854

* Fixed the fix

Co-authored-by: Gergely Imreh <[email protected]>

Co-authored-by: Karl Weinmeister <[email protected]>
Co-authored-by: sasha-gitg <[email protected]>
Co-authored-by: Gergely Imreh <[email protected]>
Co-authored-by: Ivan Cheung <[email protected]>
  • Loading branch information
5 people authored Jan 11, 2022
1 parent 4bfa11b commit 153578f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions google/cloud/aiplatform/datasets/column_names_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ def _retrieve_bq_source_columns(
if bq_table_uri.startswith(prefix):
bq_table_uri = bq_table_uri[len(prefix) :]

# The colon-based "project:dataset.table" format is no longer supported:
# Invalid dataset ID "bigquery-public-data:chicago_taxi_trips".
# Dataset IDs must be alphanumeric (plus underscores and dashes) and must be at most 1024 characters long.
# Using dot-based "project.dataset.table" format instead.
bq_table_uri = bq_table_uri.replace(":", ".")

client = bigquery.Client(project=project, credentials=credentials)
table = client.get_table(bq_table_uri)
schema = table.schema
Expand Down

0 comments on commit 153578f

Please sign in to comment.