Repository navigation
Refactor groupby grouping and Python ordering - #24562
Open
PointKernel wants to merge 12 commits into
Open
PointKernel wants to merge 12 commits into
PointKernel wants to merge 12 commits into
Conversation
…ouping-preparation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Member
Author
|
/ok to test |
wence-
approved these changes
Oct 13, 2026
wence-
left a comment
Contributor
There was a problem hiding this comment.
Approving python changes.
PointKernel
commented
Oct 13, 2026
Co-authored-by: Yunsong Wang <12716979+PointKernel@users.noreply.github.com>
mhaseeb123
approved these changes
Oct 15, 2026
| else [] | ||
| ) | ||
| positions = value_columns.pop() if need_positions else None | ||
| if not order_groups or len(offsets) <= 2: |
Contributor
There was a problem hiding this comment.
nit: get_groups already returns sorted groups with sort=True, so we can return early here. Can also drop the sort=True branch below.
Suggested change
| if not order_groups or len(offsets) <= 2: | |
| if not order_groups or self._sort or len(offsets) <= 2: |
| auto const temporary_resources = mr.as_temporary(); | ||
|
|
||
| [[maybe_unused]] auto [row_bitmask_data, row_bitmask] = | ||
| auto const num_rows = keys.num_rows(); |
Contributor
There was a problem hiding this comment.
nit: Since need_grouped_rows requires group offsets
Suggested change
| auto const num_rows = keys.num_rows(); | |
| CUDF_EXPECTS(need_group_offsets || !need_grouped_rows, | |
| "Grouped rows require group offsets", | |
| std::invalid_argument); | |
| auto const num_rows = keys.num_rows(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR separates HashCSR key grouping from aggregation and reuses group ordering and row mappings in cuDF Python and Polars. It preserves pandas-compatible group order and correctly restores row positions after
applyand window operations.Split out from #24251.
Checklist