Skip to content

Conversation

jbrockmendel
Copy link
Member

Comment on lines 545 to 550
warnings.filterwarnings(
"ignore",
"Constructing a Categorical with a dtype and values",
FutureWarning,
)
res = cls._from_sequence(scalars, dtype=dtype)
Copy link
Member

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?

Comment on lines 131 to 132
# [c, None, None, dtype2, dtype2],
# [c, ["x", "y"], False, None, dtype2],
Copy link
Member

Choose a reason for hiding this comment

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

Remove or uncomment/update?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, will update

@mroeschke mroeschke requested a review from rhshadrach August 25, 2025 19:42
Copy link
Member

@rhshadrach rhshadrach left a 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.

@rhshadrach rhshadrach added Categorical Categorical Data Type Deprecate Functionality to remove in pandas labels Sep 7, 2025
@rhshadrach rhshadrach added this to the 3.0 milestone Sep 7, 2025
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@rhshadrach rhshadrach merged commit 83c9e4a into pandas-dev:main Sep 8, 2025
38 checks passed
@rhshadrach
Copy link
Member

Thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: astype method fails to raise errors for category data type API: Categorical constructor with dtype raise instead of casting to NA
2 participants