Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@guilhermecsnpeixoto
Copy link
Contributor

This PR updates export_graphviz to raise a ValueError when receiving non-string feature names, such as numpy.int64, instead of causing an AttributeError. This follows the suggestion in issue #30834, ensuring clearer error handling and guidance for users.

Reference Issues/PRs

Fixes #30834

What does this implement/fix? Explain your changes.

Implemented parameter verification, raising valueError for invalid inputs as suggested in the respective issue.

Any other comments?

No.

@github-actions
Copy link

github-actions bot commented Mar 20, 2025

✔️ Linting Passed

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

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

@guilhermecsnpeixoto guilhermecsnpeixoto marked this pull request as draft March 20, 2025 17:25
@guilhermecsnpeixoto guilhermecsnpeixoto marked this pull request as ready for review March 25, 2025 15:47
@guilhermecsnpeixoto
Copy link
Contributor Author

Hello

I noticed that the changelog check is failing, and I wanted to confirm whether a changelog entry is required for this PR or if it can be bypassed. Please let me know how you'd like me to proceed.

Thanks for your time!

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

LGTM. @OmarManzoor this should be a quick review.

Copy link
Contributor

@OmarManzoor OmarManzoor 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 @guilhermecsnpeixoto

@OmarManzoor OmarManzoor enabled auto-merge (squash) September 23, 2025 13:55
@OmarManzoor OmarManzoor merged commit ce7b3fe into scikit-learn:main Sep 23, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: AttributeError in str_escape when handling numpy.int64 in sklearn.tree._export.py in /sklearn/tree/_export.py

3 participants