Skip to content

Curation preview rejects queries ending in a line comment #738

Closed

Description

@kstonekuan

Problem

Curation preview rejects valid SQL ending in a line comment, while the report endpoint and hflow.curate() accept it. On main at 7d202bc, against an empty catalog:

SQL POST /api/v1/curation/preview POST /api/v1/curation/report
SELECT 1 AS value 200, one row 200, one row
SELECT 1 AS value -- end 400, parser error 200, one row
SELECT 1 AS value; -- end 400, parser error 200, one row

packages/hflow-server/src/hflow_server/_curation.py:149 removes semicolons only at the end of the string. Preview embeds the SQL in a subquery at lines 259 and 285–304, so a final line comment also swallows the wrapper's closing syntax.

Done when

  • Preview accepts those two commented queries and returns the same row and count as the uncommented query, with and without stats: true.
  • Semicolons and comments inside strings, including non-ASCII text, retain their meaning. Multi-statement SQL remains refused before execution.
  • Add outcome-focused coverage to packages/hflow-server/tests/test_server_curation_preview.py:17. The SDK's handling of a statement terminator is at src/hflow/curation.py:713, and its SQL surface cases are in tests/test_catalog_curation.py.

Validation

uv sync --locked
uv run ruff check --fix
uv run ruff format
uv run ty check
uv run pytest -q

Activity

  1. added a commit that references this issue on Oct 28, 2026
    82c4cc7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions