Skip to content

Commit

Permalink
fix(bigquery): respect the fully qualified table name at the init
Browse files Browse the repository at this point in the history
  • Loading branch information
maxshine authored and cpcloud committed Jul 28, 2023
1 parent cb5f876 commit a25f460
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ibis/backends/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def dataset_id(self):
def table(self, name: str, database: str | None = None) -> ir.TableExpr:
if database is None:
database = f"{self.data_project}.{self.current_database}"
t = super().table(name, database=database)
table_id = self._fully_qualified_name(name, database)
t = super().table(table_id)
bq_table = self.client.get_table(table_id)
return rename_partitioned_column(t, bq_table, self.partition_column)

Expand Down
6 changes: 6 additions & 0 deletions ibis/backends/bigquery/tests/system/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,9 @@ def test_timestamp_table(con, temp_table):
("timestamp_col", dt.Timestamp(timezone="UTC")),
]
)


def test_fully_qualified_table_creation(con, project_id, dataset_id, temp_table):
schema = ibis.schema({'col1': dt.GeoSpatial(geotype="geography", srid=4326)})
t = con.create_table(f"{project_id}.{dataset_id}.{temp_table}", schema=schema)
assert t.get_name() == f"{project_id}.{dataset_id}.{temp_table}"

0 comments on commit a25f460

Please sign in to comment.