Skip to content

fix: Fix append regression in 0.13.5#5495

Merged
max-sixty merged 2 commits intoPRQL:mainfrom
gosupersimple:fix-5494-append-regression
Oct 31, 2025
Merged

fix: Fix append regression in 0.13.5#5495
max-sixty merged 2 commits intoPRQL:mainfrom
gosupersimple:fix-5494-append-regression

Conversation

@priithaamer
Copy link
Copy Markdown
Contributor

Attempt to fix #5494

@eitsupi eitsupi changed the title Fix append regression fix: Fix append regression in 0.13.5 Oct 13, 2025
@eitsupi eitsupi requested a review from Copilot October 13, 2025 13:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a regression in the append functionality introduced in version 0.13.5. The fix addresses issue #5494 by improving the positional mapping logic for UNION operations in SQL generation.

  • Adds bounds checking to prevent invalid array access when applying positional mappings
  • Ensures positional mappings are only stored when complete (all columns matched)
  • Adds defensive programming with logging for better debugging

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

File Description
prqlc/prqlc/src/sql/pq/positional_mapping.rs Core fix adding bounds validation and completeness checks for positional mappings
prqlc/prqlc/tests/integration/queries/append_cte_complex.prql New test case demonstrating complex append scenarios with CTEs
Multiple snapshot files Updated test snapshots reflecting the regression fix and new test additions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread prqlc/prqlc/src/sql/pq/positional_mapping.rs
Comment thread prqlc/prqlc/src/sql/pq/positional_mapping.rs
@max-sixty
Copy link
Copy Markdown
Member

thanks @priithaamer . sorry for the regression.

let's merge? or any other feedback?

@max-sixty
Copy link
Copy Markdown
Member

I did the same re reducing the integration tests for this — https://github.com/max-sixty/prql/tree/fix-5494-append-regression (or I can push to this MR with perms)

@eitsupi
Copy link
Copy Markdown
Member

eitsupi commented Oct 25, 2025

@priithaamer Could you take a look at this?

Replace the comprehensive integration test with a focused inline test that
verifies the append with CTEs regression fix. The test ensures positional
mapping doesn't cause out-of-bounds errors when using append with let statements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@priithaamer
Copy link
Copy Markdown
Contributor Author

@eitsupi sorry for the delay. I've merged improvements from https://github.com/max-sixty/prql/tree/fix-5494-append-regression

@max-sixty max-sixty merged commit ab54f08 into PRQL:main Oct 31, 2025
35 of 36 checks passed
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.

append regression in 0.13.5

4 participants