Skip to content

Commit d6775d6

Browse files
neuralsorcerermeta-codesync[bot]
authored andcommitted
Replace deprecated categorical dtype detection (#197)
Summary: Replaced deprecated categorical dtype detection to eliminate pandas warnings during tests. ```text DeprecationWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.CategoricalDtype) instead ``` Pull Request resolved: #197 Differential Revision: D88366966 Pulled By: talgalili fbshipit-source-id: aad43b194c83931ce19acda6ed70275b3cb25de6
1 parent 4900fa2 commit d6775d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

balance/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def _is_categorical_dtype(series: pd.Series) -> bool:
203203
dtype = series.dtype
204204
return (
205205
pd_types.is_object_dtype(dtype)
206-
or pd_types.is_categorical_dtype(dtype)
206+
or isinstance(dtype, pd.CategoricalDtype)
207207
or pd_types.is_string_dtype(dtype)
208208
)
209209

0 commit comments

Comments
 (0)