Skip to content

Conversation

@max-sixty
Copy link
Member

Summary

  • Fix sorting being incorrectly dropped when using group {} (sort a | take 1)
  • Empty group {} should preserve inner sort since there's no actual partitioning

Before:

SELECT * FROM foo LIMIT 1

After:

SELECT * FROM foo ORDER BY a LIMIT 1

Test plan

  • Added test test_group_empty_preserves_sort
  • Verified non-empty groups still work correctly (sort stays internal to partition)
  • All 631 tests pass
  • Lints pass

Fixes #5100

🤖 Generated with Claude Code

max-sixty and others added 2 commits December 20, 2025 18:01
Replace internal compiler error with user-facing error message when a
bare lambda like `x -> y` is used at the top level. Now produces:
"expected a table, but found a function"

Fixes PRQL#4280

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

Co-Authored-By: Claude <[email protected]>
When using `group {} (sort a | take 1)`, the inner sort was being
incorrectly dropped because `sort_undone` was unconditionally set
to true for all groups. Now only set `sort_undone` when there's an
actual partition (non-empty group keys).

Fixes PRQL#5100

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

Co-Authored-By: Claude <[email protected]>
@max-sixty max-sixty merged commit 394c590 into PRQL:main Dec 21, 2025
35 checks passed
@max-sixty max-sixty deleted the bug-fixes branch December 21, 2025 02:25
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.

Sorting disappears with empty group

1 participant