Skip to content

Fix PandasAdapter causes crash or misattributed features #31079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 11, 2025

Conversation

nicolas-bolle
Copy link
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

Copy link

github-actions bot commented Mar 26, 2025

✔️ 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
Contributor Author

@glemaitre wondering if I can get a review?

Copy link
Member

@jeremiedbb jeremiedbb left a comment

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
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
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?

Copy link
Member

@jeremiedbb jeremiedbb left a comment

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
Copy link
Member

@thomasjpfan thomasjpfan left a comment

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