-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improve categorical converter error message #17824
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
Conversation
It's slightly more specific than an |
I agree the error message should be something more actionable e.g. "not a valid categorical unit" or similar |
How about now? I think this is a small improvement avoids the user having to work out where and why the attribute error was thrown, immediately saying "the problem was with the unit passed to a categorical converter". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slightly concerned since ._mapping
is a private attribute so I don't quite know what users can do to fix this error.
It is at least a less-confusing error message that the type error (for the same private attribute) that they are getting now. |
PR Summary
xref #11095. Provide a nicer error message if the user tries to set a
unit
without_mapping
to a categorical converter.PR Checklist