diff --git a/docs/tutorials/getting_started.qmd b/docs/tutorials/getting_started.qmd index f55c79d3a59e..ab66577b7ff9 100644 --- a/docs/tutorials/getting_started.qmd +++ b/docs/tutorials/getting_started.qmd @@ -30,7 +30,6 @@ con.create_table( You can now see the example dataset copied over to the database: ```{python} -con = ibis.connect("duckdb://penguins.ddb") con.list_tables() ``` diff --git a/ibis/backends/duckdb/__init__.py b/ibis/backends/duckdb/__init__.py index 649d02fa0edd..cdec3aee291a 100644 --- a/ibis/backends/duckdb/__init__.py +++ b/ibis/backends/duckdb/__init__.py @@ -169,9 +169,12 @@ def create_table( if temp: properties.append(sge.TemporaryProperty()) + temp_memtable_view = None + if obj is not None: if not isinstance(obj, ir.Expr): table = ibis.memtable(obj) + temp_memtable_view = table.op().name else: table = obj @@ -248,6 +251,9 @@ def create_table( ).sql(self.name) ) + if temp_memtable_view is not None: + self.con.unregister(temp_memtable_view) + return self.table(name, database=database) def _load_into_cache(self, name, expr):