From e0722aea84b09333fb5151d3014dde805ecd3f08 Mon Sep 17 00:00:00 2001 From: Sheilah Date: Wed, 26 Jan 2022 09:05:12 -0800 Subject: [PATCH] using pandas is_integer() and float() instead --- python/cudf/cudf/core/dataframe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/cudf/cudf/core/dataframe.py b/python/cudf/cudf/core/dataframe.py index 439af3de222..e973468a322 100644 --- a/python/cudf/cudf/core/dataframe.py +++ b/python/cudf/cudf/core/dataframe.py @@ -20,6 +20,7 @@ from numba import cuda from nvtx import annotate from pandas._config import get_option +from pandas.core.dtypes.common import is_float, is_integer from pandas.io.formats import console from pandas.io.formats.printing import pprint_thing @@ -33,7 +34,6 @@ is_datetime_dtype, is_dict_like, is_dtype_equal, - is_integer, is_list_dtype, is_list_like, is_numeric_dtype, @@ -2653,7 +2653,7 @@ def diff(self, periods=1, axis=0): """ if not is_integer(periods): - if not (isinstance(periods, float) and isinstance(periods, int)): + if not (is_float(periods) and periods.is_integer()): raise ValueError("periods must be an integer") periods = int(periods)