Skip to content

Replace deprecated categorical dtype detection#197

Closed
neuralsorcerer wants to merge 1 commit intofacebookresearch:mainfrom
neuralsorcerer:dep
Closed

Replace deprecated categorical dtype detection#197
neuralsorcerer wants to merge 1 commit intofacebookresearch:mainfrom
neuralsorcerer:dep

Conversation

@neuralsorcerer
Copy link
Collaborator

Replaced deprecated categorical dtype detection to eliminate pandas warnings during tests.

DeprecationWarning:

  is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead

Copilot AI review requested due to automatic review settings December 4, 2025 10:23
@meta-cla meta-cla bot added the cla signed label Dec 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a deprecation warning by replacing the deprecated pd_types.is_categorical_dtype() function with the recommended isinstance(dtype, pd.CategoricalDtype) check.

Key Changes:

  • Updated _is_categorical_dtype() function in balance/util.py to use isinstance(dtype, pd.CategoricalDtype) instead of the deprecated pd_types.is_categorical_dtype(dtype)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@meta-codesync
Copy link

meta-codesync bot commented Dec 4, 2025

@talgalili has imported this pull request. If you are a Meta employee, you can view this in D88366966.

@talgalili talgalili added this to the balance 0.14.0 milestone Dec 4, 2025
@meta-codesync meta-codesync bot closed this in d6775d6 Dec 4, 2025
@meta-codesync
Copy link

meta-codesync bot commented Dec 4, 2025

@talgalili merged this pull request in d6775d6.

@neuralsorcerer neuralsorcerer deleted the dep branch December 4, 2025 13:58
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.

4 participants