refactor(snowflake): strip trailing semicolon on unlimited query path for connector consistency - #2593
refactor(snowflake): strip trailing semicolon on unlimited query path for connector consistency#2593Bartok9 wants to merge 3 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughSnowflake query execution now strips trailing semicolons before limited and unlimited execution. The limit wrapper uses the normalized SQL, and a unit test verifies the unlimited execution statement. ChangesSnowflake query execution
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code reviewTwo issues. 1. This deletes a comment that explains a non-obvious design decision. WrenAI/core/wren/src/wren/connector/snowflake.py Lines 55 to 66 in 5d2637c The removed text records why the limited path wraps in a subquery — LIMIT pushdown to avoid downloading a full result set, and preserving an existing 2. The new claim is unsubstantiated. "Snowflake rejects bare trailing terminators in some clients" — which clients, and under what conditions? Also: #2556 is the same change to the same file. One of the two should close — this one's test is the better of the pair. Rebase before merge — 3 commits behind |
5248dc5 to
3a01b8d
Compare
|
Rebased onto current
Ready for another look. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Keep LIMIT pushdown/subquery rationale comments and coerce_limit. Align unlimited execute with dry_run and other connectors (Canner#2595).
3a01b8d to
2e8dd2c
Compare
|
@goldmedal rebased on current
Earlier CI reds on this branch looked like GitHub Actions “Service Unavailable” fetching actions, not test assertion failures — fresh push should re-run cleanly. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
This one now matches the merged precedents — #2595 (mysql) and #2633 (mssql) — and the retitle to One leftover to tidy. The pre-existing comment above
After this change the strip happens before the wrap, so the first half of that rationale no longer describes why the wrap exists — the semicolon is already gone by then. The ORDER BY half is still accurate. Please update that sentence so the comment matches the new ordering rather than leaving a documented rationale that the code has moved past. With that, this is good to go from my side. |
Drop the trailing-semicolon composition rationale from the subquery wrap comment now that strip_trailing_semicolon runs before the wrap; keep the ORDER BY / pushdown reason.
|
@goldmedal Updated the LIMIT-wrap comment so it no longer cites trailing-semicolon composition (strip already runs first). Kept the ORDER BY / pushdown rationale. Ready for another look. |
Summary
Strip trailing
;on Snowflake unlimitedquery()so it matchesdry_runand other connectors (see merged #2595 mysql).Motivation
Honest framing: this is connector consistency, not a proven
snowflake-connector-pythonrejection ofSELECT 1;. Limited path already stripped inside the subquery wrap; unlimited did not.Review follow-through (@goldmedal)
refactor(...).coerce_limitfrom main.;.Verification
Summary by CodeRabbit
Bug Fixes
Tests