Repository navigation
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughTrino SQL cleanup now removes terminating semicolon runs and surrounding whitespace while preserving semicolons inside string literals. Unit tests cover repeated trailing semicolons and whitespace-separated terminators. ChangesTrino SQL cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
37cf98a to
d10f093
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/wren/tests/unit/test_trino_parser.py`:
- Around line 148-151: The test cases for trailing semicolon stripping need
direct coverage for semicolons inside string literals. In the relevant parser
test cases, add an assertion such as SELECT 'hello;'; transforming to SELECT
'hello;', ensuring _strip_trailing_semicolon() removes only the terminating
separator and preserves the literal content.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fd1fdf29-2ce9-42d8-b508-53f000649943
📒 Files selected for processing (2)
core/wren/src/wren/connector/trino.pycore/wren/tests/unit/test_trino_parser.py
|
The shared CI failure here ( |
ca69f6a to
5334780
Compare
|
Done — rebased onto latest |
removesuffix(";") only dropped a single trailing semicolon, so
SELECT 1;; still produced invalid subquery SQL. Match postgres/canner
and strip the full terminating ;/whitespace run.
5334780 to
ed0a506
Compare
|
This overlaps with #2480 — I think we can consolidate on that one. Both make the same functional change at the same call sites:
So the outcome is identical ( Plan is to keep #2480 and close this one once it lands. Thanks for the fix — it's carried over intact. |
|
Agreed — #2480 folding both call sites into the shared |
|
@Bartok9, there are some conflicts. I think the PR should also use the shared trailing function. |
|
Thanks @goldmedal! Since #2480 has now merged and carries this multi-semicolon fix intact via the shared |
Summary
_strip_trailing_semicolonto drop the full terminating run of;/ whitespace (not just oneremovesuffix(";")).SELECT 1;;/; ;\nno longer break limit/dry_run subquery wraps.Motivation
Limit/dry_run wrap user SQL as
SELECT * FROM ({sql}) AS _sub LIMIT N. A single trailing semicolon was handled, but double terminators (common from copy-paste / client dsn tooling) still left;)in the wrapped SQL. Aligns with postgres/canner/clickhouse.Apache-2.0 path:
core/wren/**only.Verification
Python check on main (behavior proof):
"SELECT 1;;".rstrip().removesuffix(";").rstrip()→"SELECT 1;"(still broken)"SELECT 1"Duplicates
No open issue/PR solely for multi-semicolon Trino strip (semicolon work historically landed one-terminator helpers). Focused non-shim fix.
Summary by CodeRabbit