-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
Thanks—code looks good overall! 👍
Could you add a small regression test for keep_connection
before we merge?
Something like:
def test_temp_table_persists_with_keep_connection():
with tempfile.TemporaryDirectory() as tmpdir:
cfg = Config(db_path=tmp_path / "test.db", keep_connection=True)
db = DuckDBDatabase(cfg)
db.execute_query("CREATE TEMP TABLE t AS SELECT 1 AS v")
assert db.execute_query("SELECT v FROM t") == [(1,)]
def test_temp_table_does_not_persist_without_keep_connection():
with tempfile.TemporaryDirectory() as tmpdir:
cfg = Config(db_path=tmp_path / "test.db", keep_connection=False)
db = DuckDBDatabase(cfg)
db.execute_query("CREATE TEMP TABLE t AS SELECT 1 AS v")
with pytest.raises(duckdb.Error):
db.execute_query("SELECT v FROM t")
(No need for full fixtures—just something that covers both code paths.)
Originally posted by @ktanaka101 in #24 (review)
Metadata
Metadata
Assignees
Labels
No labels