Skip to content

Commit 4fa395f

Browse files
committed
fix(duckdb): always create temp tables in temp.main
1 parent 8e813b0 commit 4fa395f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ibis/backends/duckdb/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def create_table(
155155
if temp:
156156
properties.append(sge.TemporaryProperty())
157157
catalog = "temp"
158+
database = "main"
158159

159160
if obj is not None:
160161
if not isinstance(obj, ir.Expr):

ibis/backends/duckdb/tests/test_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,10 @@ def test_create_table_with_nulls(con, kwargs):
465465

466466
with pytest.raises(com.IbisTypeError, match="NULL typed columns"):
467467
con.create_table(name, **kwargs)
468+
469+
470+
def test_create_table_in_nondefault_schema():
471+
con = ibis.duckdb.connect()
472+
con.create_database("my_schema")
473+
con.raw_sql("USE my_schema")
474+
con.create_table("foo", {"id": [1, 2, 3]}, temp=True)

0 commit comments

Comments
 (0)