Skip to content

refine: remove dead branch and fix comment typos in intersect/except preprocess - #6079

Merged
max-sixty merged 1 commit into
mainfrom
refine/preprocess-intersect-cleanup
Jul 14, 2026
Merged

refine: remove dead branch and fix comment typos in intersect/except preprocess#6079
max-sixty merged 1 commit into
mainfrom
refine/preprocess-intersect-cleanup

Conversation

@prql-bot

Copy link
Copy Markdown
Collaborator

Small cleanup in prqlc/prqlc/src/sql/pq/preprocess.rs, found during the nightly code-quality sweep.

Dead code

In intersect, if res.is_empty() { continue; } sits directly after res.push(t), so res always has at least one element and the branch is unreachable. Removed it. (The analogous guard in except is the meaningful if res.len() < 2, which is left untouched.)

Comment typos

  • INTERCEPT ALL is not supportedINTERSECT ALL is not supported
  • Don't create InterceptDon't create Intersect
  • INTERSECT ALL can become except INTERSECT DISTINCT → drop the stray except
  • EXCEPT ALL can become except EXCEPT DISTINCT → drop the stray except

No behavior change — the removed branch was provably unreachable and the rest are comment-only. cargo test -p prqlc --lib and the full integration suite (471 tests, including the sql:: set that exercises intersect/except) pass, so no new regression test is added.

…preprocess

- Remove `if res.is_empty() { continue; }` in `intersect`: it sits directly
  after `res.push(t)`, so `res` always has at least one element and the
  branch is unreachable.
- Fix comment typos: `INTERCEPT`/`Intercept` -> `INTERSECT`/`Intersect`,
  and drop stray `except` words in the INTERSECT/EXCEPT `ALL -> DISTINCT`
  comments.
@max-sixty
max-sixty merged commit 0d6fc7a into main Jul 14, 2026
36 checks passed
@max-sixty
max-sixty deleted the refine/preprocess-intersect-cleanup branch July 14, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants