Skip to content

Preserve input columns in stratified splitters - #2419

Merged
miguelgfierro merged 3 commits into
recommenders-team:stagingfrom
Afloat16:fix/preserve-split-columns-20261029
Nov 5, 2026
Merged

miguelgfierro merged 3 commits into
recommenders-team:stagingfrom
Afloat16:fix/preserve-split-columns-20261029

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Added regression tests.
  • Commit includes the required Signed-off-by trailer.
  • Targets staging.
    Documentation: no new API; existing data-preservation behavior is restored.

@miguelgfierro miguelgfierro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks

@miguelgfierro
miguelgfierro merged commit 6fb74f8 into recommenders-team:staging Nov 5, 2026
2 of 6 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.

2 participants