Skip to content

Commit 0ab4371

Browse files
suryaiyer95claude
andcommitted
fix: guard _execute_task against synthetic status/error rows from executor
The executor returns `row_count=0` with a synthetic `["Query executed successfully"]` row when SQL returns no results. Without this guard, the Rust engine interprets the status row as actual data, causing false "duplicate key" errors in JoinDiff. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ffebdab commit 0ab4371

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • packages/altimate-engine/src/altimate_engine/sql

packages/altimate-engine/src/altimate_engine/sql/data_diff.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ def _execute_task(task: dict, warehouse: str) -> dict:
5656
)
5757

5858
# Convert SqlExecuteResult rows to the format expected by ReladiffSession.step()
59+
# Guard: executor returns a synthetic status row when row_count is 0 — skip it.
5960
rows: list[list[str | None]] = []
60-
for row in result.rows:
61-
rows.append([str(v) if v is not None else None for v in row])
61+
if result.row_count > 0:
62+
for row in result.rows:
63+
rows.append([str(v) if v is not None else None for v in row])
6264

6365
return {"id": task["id"], "rows": rows}
6466

0 commit comments

Comments
 (0)