Skip to content

Commit 51b5a53

Browse files
Support project.dataset in schema argument
1 parent 908fc5e commit 51b5a53

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pybigquery/sqlalchemy_bigquery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ def _table_reference(self, provided_schema_name, provided_table_name,
382382
else:
383383
dataset_id_from_schema = provided_schema_name_split[0]
384384
elif len(provided_schema_name_split) == 2:
385-
pass
385+
project_id_from_schema = provided_schema_name_split[0]
386+
dataset_id_from_schema = provided_schema_name_split[1]
386387
# TODO: Get a test for an else statement here
387388
project_id = project_id_from_schema or project_id_from_table or client_project
388389
dataset_id = dataset_id_from_schema or dataset_id_from_table or self.dataset_id

test/test_sqlalchemy_bigquery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ def test_get_columns(inspector, inspector_using_test_dataset):
489489
(None, 'dataset.table', 'project'),
490490
(None, 'project.dataset.table', 'other_project'),
491491
('project', 'dataset.table', 'other_project'),
492+
('project.dataset', 'table', 'other_project'),
492493
])
493494
def test_table_reference(dialect, provided_schema_name,
494495
provided_table_name, client_project):

0 commit comments

Comments
 (0)