Skip to content

Fix PandasAdapter causes crash or misattributed features - #31079

Merged
thomasjpfan merged 7 commits into
scikit-learn:mainfrom
nicolas-bolle:PandasAdapter_pdSeries
Jul 11, 2025
Merged

Fix PandasAdapter causes crash or misattributed features#31079
thomasjpfan merged 7 commits into
scikit-learn:mainfrom
nicolas-bolle:PandasAdapter_pdSeries

Conversation

@nicolas-bolle

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #31051. See also #28731.

What does this implement/fix? Explain your changes.

Any other comments?

  • Added a unit test for the "series" case
  • Made the unit test index different from the default index, since the issue doesn't happen when using default indexes

@github-actions

github-actions Bot commented Mar 26, 2025

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: c62372b. Link to the linter CI: here

@nicolas-bolle

Copy link
Copy Markdown
Contributor Author

@glemaitre wondering if I can get a review?

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR @nicolas-bolle. I think a higher level non regression test very similar the the reproducer that you posted in #31051 would be useful. Please also add a changelog entry.

@jeremiedbb
jeremiedbb force-pushed the PandasAdapter_pdSeries branch from f4fbd4c to 2b03d29 Compare July 10, 2025 14:35
@jeremiedbb

Copy link
Copy Markdown
Member

Thanks @nicolas-bolle. I just moved the test into the column transformer dedicated tests and made the changelog entry about a fix of the column transformer because we usually don't mention private API in the changelog and instead how it impacts the user. Please let me know if the new phrasing is fine, don't hesitate to edit it if it needs improvement.

@nicolas-bolle

Copy link
Copy Markdown
Contributor Author

Thanks @nicolas-bolle. I just moved the test into the column transformer dedicated tests and made the changelog entry about a fix of the column transformer because we usually don't mention private API in the changelog and instead how it impacts the user. Please let me know if the new phrasing is fine, don't hesitate to edit it if it needs improvement.

Yep thanks @jeremiedbb this looks great, thanks for the edits. Anything else needed before getting reviews?

Comment thread doc/whats_new/upcoming_changes/sklearn.compose/31079.fix.rst Outdated

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks @nicolas-bolle

@jeremiedbb jeremiedbb added this to the 1.7.1 milestone Jul 11, 2025
@jeremiedbb jeremiedbb added the To backport PR merged in master that need a backport to a release branch defined based on the milestone. label Jul 11, 2025

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@thomasjpfan
thomasjpfan merged commit f187311 into scikit-learn:main Jul 11, 2025
40 checks passed
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 15, 2025
…arn#31079)

Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
@jeremiedbb jeremiedbb mentioned this pull request Jul 15, 2025
13 tasks
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
…arn#31079)

Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
…arn#31079)

Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
…arn#31079)

Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
…arn#31079)

Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
jeremiedbb added a commit to jeremiedbb/scikit-learn that referenced this pull request Jul 16, 2025
…arn#31079)

Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:utils To backport PR merged in master that need a backport to a release branch defined based on the milestone.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PandasAdapter causes crash or misattributed features

3 participants