Repository navigation
Preserve input columns in stratified splitters - #2419
Merged
miguelgfierro merged 3 commits intoNov 5, 2026
Merged
miguelgfierro merged 3 commits into
miguelgfierro merged 3 commits into
Conversation
Signed-off-by: Afloat <[email protected]>
Afloat16
requested review from
SimonYansenZhao,
anargyri,
loomlike,
miguelgfierro and
wav8k
as code owners
October 30, 2026 10:06
miguelgfierro
approved these changes
Nov 5, 2026
miguelgfierro
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, thanks
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
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
The stratified splitters use random, count and rank as temporary columns. This overwrites or removes existing user columns and can break grouping columns with those names. The random splitter can also modify the input DataFrame.
Keep ordering keys and per-group counts/ranks separate from the data. Preserve original columns and seeded row ordering.
Validation
On staging at 8f5afc2, the new cases produce 8 failures and 1 passing control. With the fix, the complete splitter file and new regressions pass (17 tests). Coverage includes duplicate indices, custom column names, input immutability, minimum-rating filtering and seeded ordering.
Checklist
Documentation: no new API; existing data-preservation behavior is restored.