Skip to content

Commit c0175ef

Browse files
committed
fix mypy
1 parent b50c753 commit c0175ef

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

bigframes/session/_io/bigquery/read_gbq_table.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ def _convert_information_schema_table_id_to_table_reference(
6060
else:
6161
project = ".".join(parts[:dataset_index])
6262

63+
if project is None:
64+
message = (
65+
"Could not determine project ID. "
66+
"Please provide a project or region in your INFORMATION_SCHEMA table ID, "
67+
"For example, 'region-REGION_NAME.INFORMATION_SCHEMA.JOBS'."
68+
)
69+
raise ValueError(message)
70+
6371
dataset = "INFORMATION_SCHEMA"
6472
table_id_short = ".".join(parts[dataset_index + 1 :])
6573
return bigquery.TableReference(

tests/unit/session/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def test_read_gbq_cached_table():
242242
table._properties["numRows"] = "1000000000"
243243
table._properties["location"] = session._location
244244
table._properties["type"] = "TABLE"
245-
session._loader._df_snapshot[table_ref] = (
245+
session._loader._df_snapshot[str(table_ref)] = (
246246
datetime.datetime(1999, 1, 2, 3, 4, 5, 678901, tzinfo=datetime.timezone.utc),
247247
table,
248248
)

0 commit comments

Comments
 (0)