Skip to content

refine: remove dead commented-out code in window transform resolver - #6097

Merged
max-sixty merged 1 commit into
mainfrom
refine/window-transform-dead-comments
Jul 25, 2026
Merged

refine: remove dead commented-out code in window transform resolver#6097
max-sixty merged 1 commit into
mainfrom
refine/window-transform-dead-comments

Conversation

@prql-bot

Copy link
Copy Markdown
Collaborator

Found during the nightly code-quality survey of semantic/resolver/transforms.rs.

The window transform arm carried two commented-out lines that are superseded by the Range { start, end } construction immediately below them:

// let start = Expr::new(start.map_or(Literal::Null, Literal::Integer));
// let end = Expr::new(end.map_or(Literal::Null, Literal::Integer));
let range = Range {
    start: start.map(Literal::Integer).map(Expr::new).map(Box::new),
    end: end.map(Literal::Integer).map(Expr::new).map(Box::new),
};

Besides being dead, the commented-out version is now actively misleading: it maps None to Literal::Null via map_or, whereas the live code maps None to None (an absent bound) via map. A future reader comparing the two could reasonably think Null was the intended behavior. Removing the stale comment.

No behavioral change — the lines were never compiled. No regression test is applicable since nothing executable changed; verified with cargo build -p prqlc and the existing sql::gen_query::test::test_filter_windowed window test, both green.

@max-sixty
max-sixty merged commit 821f16a into main Jul 25, 2026
36 checks passed
@max-sixty
max-sixty deleted the refine/window-transform-dead-comments branch July 25, 2026 20:01
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