From d1377a580656526119a33cabb898becd15cf152a Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Mon, 13 Mar 2023 16:06:56 -0500 Subject: [PATCH] Add information about `Index.is_*` method deprecation (#12909) 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 --- python/cudf/cudf/core/_base_index.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/cudf/cudf/core/_base_index.py b/python/cudf/cudf/core/_base_index.py index 88763b8a011..1d0a30b556d 100644 --- a/python/cudf/cudf/core/_base_index.py +++ b/python/cudf/cudf/core/_base_index.py @@ -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, @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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",