From a98a0f56ecfb3fdea29e0f6886356d57c5769e9a Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:31:15 -0400 Subject: [PATCH] chore(bigquery): implement `_finalize_memtable` so we can handle the session dataset usage --- ibis/backends/bigquery/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ibis/backends/bigquery/__init__.py b/ibis/backends/bigquery/__init__.py index fd81a778b9fa5..7993d856992ea 100644 --- a/ibis/backends/bigquery/__init__.py +++ b/ibis/backends/bigquery/__init__.py @@ -180,6 +180,17 @@ 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( + name, + db=session_dataset.dataset_id, + catalog=session_dataset.project, + quoted=self.compiler.quoted, + ) + drop_sql_stmt = sge.Drop(kind="TABLE", this=table_id, exists=True) + self.raw_sql(drop_sql_stmt) + def _register_in_memory_table(self, op: ops.InMemoryTable) -> None: session_dataset = self._session_dataset