Skip to content

Commit

Permalink
Add information about Index.is_* method deprecation (#12909)
Browse files Browse the repository at this point in the history
This PR adds additional information for the following Index APIs to match with pandas 2.0:

 is_numeric
 is_boolean
 is_integer
 is_floating
 is_object
 is_categorical
 is_interval
  • Loading branch information
galipremsagar authored Mar 13, 2023
1 parent 61843ed commit d1377a5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/cudf/cudf/core/_base_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pandas as pd

import cudf
import warnings
from cudf._lib.copying import _gather_map_is_valid, gather
from cudf._lib.stream_compaction import (
apply_boolean_mask,
Expand Down Expand Up @@ -858,6 +859,7 @@ def is_numeric(self):
>>> idx.is_numeric()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_numeric is deprecated. "
"Use cudf.api.types.is_any_real_numeric_dtype instead",
Expand Down Expand Up @@ -902,6 +904,7 @@ def is_boolean(self):
>>> idx.is_boolean()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_boolean is deprecated. "
"Use cudf.api.types.is_bool_dtype instead",
Expand Down Expand Up @@ -946,6 +949,7 @@ def is_integer(self):
>>> idx.is_integer()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_integer is deprecated. "
"Use cudf.api.types.is_integer_dtype instead",
Expand Down Expand Up @@ -997,6 +1001,7 @@ def is_floating(self):
>>> idx.is_floating()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_floating is deprecated. "
"Use cudf.api.types.is_float_dtype instead",
Expand Down Expand Up @@ -1042,6 +1047,7 @@ def is_object(self):
>>> idx.is_object()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_object is deprecated. "
"Use cudf.api.types.is_object_dtype instead",
Expand Down Expand Up @@ -1094,6 +1100,7 @@ def is_categorical(self):
>>> s.index.is_categorical()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_categorical is deprecated. "
"Use cudf.api.types.is_categorical_dtype instead",
Expand Down Expand Up @@ -1140,6 +1147,7 @@ def is_interval(self):
>>> idx.is_interval()
False
"""
# TODO: Only remove this deprecation after pandas removes this API.
warnings.warn(
f"{type(self).__name__}.is_interval is deprecated. "
"Use cudf.api.types.is_interval_dtype instead",
Expand Down

0 comments on commit d1377a5

Please sign in to comment.