fix(redshift): coerce LIMIT before SQL interpolation - #2635
Conversation
Validate limit via int() and reject negatives before embedding in the subquery LIMIT clause.
WalkthroughThe Redshift connector now validates and normalizes query limits before SQL interpolation. Tests cover invalid limits and confirm that string limits become numeric SQL values. ChangesRedshift limit validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
|
Closing in favour of a single consolidated change — thanks for the work, the underlying tidy-up is worth doing, just not as one PR per connector. Why this is being closed rather than reviewed:
On the
What remains is genuine but smaller: a negative limit currently surfaces as a driver-level error instead of a clear What we would take instead — a single PR,
#2624 is the natural home for that; it is being kept open with a note to that effect. On this PR specifically — |
Summary
Redshift LIMIT path only used
int(limit)inline without rejecting negatives. Centralize coerce + tests.Test plan
cd core/wren && .venv/bin/python -m pytest tests/unit/test_redshift_coerce_limit.py -q(3 passed)Summary by CodeRabbit
Bug Fixes
Tests