Skip to content

Commit

Permalink
chore(bigquery): implement _finalize_memtable so we can handle the …
Browse files Browse the repository at this point in the history
…session dataset usage
  • Loading branch information
cpcloud committed Sep 10, 2024
1 parent dd2ee70 commit b1aab14
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ibis/backends/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,19 @@ def _in_memory_table_exists(self, name: str) -> bool:
else:
return True

def _finalize_memtable(self, name: str) -> None:
session_dataset = self._session_dataset
table_id = sg.table(

Check warning on line 185 in ibis/backends/bigquery/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/bigquery/__init__.py#L184-L185

Added lines #L184 - L185 were not covered by tests
name, db=session_dataset.dataset_id, catalog=session_dataset.project
)
drop_sql_stmt = sge.Drop(kind="TABLE", this=table_id, exists=True)
self.raw_sql(drop_sql_stmt)

Check warning on line 189 in ibis/backends/bigquery/__init__.py

View check run for this annotation

Codecov / codecov/patch

ibis/backends/bigquery/__init__.py#L188-L189

Added lines #L188 - L189 were not covered by tests

def _register_in_memory_table(self, op: ops.InMemoryTable) -> None:
session_dataset = self._session_dataset

table_id = sg.table(
op.name,
db=session_dataset.dataset_id,
catalog=session_dataset.project,
quoted=False,
op.name, db=session_dataset.dataset_id, catalog=session_dataset.project
).sql(dialect=self.name)

bq_schema = BigQuerySchema.from_ibis(op.schema)
Expand Down

0 comments on commit b1aab14

Please sign in to comment.