From 77c1a97f5c3f3e4f4409a176844f9cbfe488aa1c Mon Sep 17 00:00:00 2001 From: Pratik Priyanshu Das Date: Sun, 30 Aug 2026 15:37:36 +0530 Subject: [PATCH 1/2] test: pin SQL surface for curate and document exactly one SELECT rule --- docs/CATALOG.md | 1 + tests/test_catalog_curation.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/CATALOG.md b/docs/CATALOG.md index 0ee207c..465869c 100644 --- a/docs/CATALOG.md +++ b/docs/CATALOG.md @@ -155,6 +155,7 @@ hflow curate --sql-file query.sql \ Pass exactly one of the positional SQL string or `--sql-file`; passing both or neither is an error. +The curate() function accepts exactly one SELECT statement The manifest is written **manifest-last**: to a temp file, renamed into place only after the query completed, so a partial manifest is unreachable. diff --git a/tests/test_catalog_curation.py b/tests/test_catalog_curation.py index 69aa964..9dbe5e0 100644 --- a/tests/test_catalog_curation.py +++ b/tests/test_catalog_curation.py @@ -837,6 +837,21 @@ def test_constrained_connection_confines_sql_to_the_catalog(tmp_path: Path) -> N False, id="legitimate-single-select", ), + pytest.param( + "PIVOT episodes ON status USING count(*)", + True, + id="pivot", # DuckDB secretly expands this to CREATE then SELECT + ), + pytest.param( + "DESCRIBE SELECT * FROM episodes", + False, + id="describe", + ), + pytest.param( + "SUMMARIZE SELECT ...", + False, + id="summarize", + ), ] From bb74ff7c307e42eea23f6bb0b5039971c13656c0 Mon Sep 17 00:00:00 2001 From: Pratik Priyanshu Das Date: Sun, 30 Aug 2026 15:50:08 +0530 Subject: [PATCH 2/2] fix: adjust describe and summarize tests to return exactly one row --- tests/test_catalog_curation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_catalog_curation.py b/tests/test_catalog_curation.py index 9dbe5e0..ecdae80 100644 --- a/tests/test_catalog_curation.py +++ b/tests/test_catalog_curation.py @@ -843,12 +843,12 @@ def test_constrained_connection_confines_sql_to_the_catalog(tmp_path: Path) -> N id="pivot", # DuckDB secretly expands this to CREATE then SELECT ), pytest.param( - "DESCRIBE SELECT * FROM episodes", + "DESCRIBE SELECT episode_id FROM episodes", False, id="describe", ), pytest.param( - "SUMMARIZE SELECT ...", + "SUMMARIZE SELECT episode_id FROM episodes", False, id="summarize", ),