-
-
Notifications
You must be signed in to change notification settings - Fork 19k
DEPR: Categorical with values not present in categories #62142
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
pandas/core/arrays/categorical.py
Outdated
warnings.filterwarnings( | ||
"ignore", | ||
"Constructing a Categorical with a dtype and values", | ||
FutureWarning, | ||
) | ||
res = cls._from_sequence(scalars, dtype=dtype) |
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.
What happens here once the deprecation is enforced?
pandas/tests/dtypes/test_dtypes.py
Outdated
# [c, None, None, dtype2, dtype2], | ||
# [c, ["x", "y"], False, None, dtype2], |
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.
Remove or uncomment/update?
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.
good catch, will update
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.
Sorry, fell off my radar for a bit. Looks good, but will need to replace FutureWarning
with Pandas4Warning
throughout.
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.
lgtm
Thanks @jbrockmendel |
astype
method fails to raise errors forcategory
data type #59899doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.