Skip to content

Commit 20bec13

Browse files
NickCrewscpcloud
andauthored
fix(duckdb): always create temp tables in temp.main (#11092)
Co-authored-by: Phillip Cloud <[email protected]>
1 parent 0905e12 commit 20bec13

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,11 @@ 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_temp_table_in_nondefault_schema():
471+
con = ibis.duckdb.connect()
472+
database = gen_name("nondefault_schema")
473+
con.create_database(database)
474+
con.con.execute(f"USE {database}")
475+
con.create_table("foo", {"id": [1, 2, 3]}, temp=True)

0 commit comments

Comments
 (0)