From 093fe6ad220173446aca8d03d1535f4a09e00dec Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 20 Feb 2024 04:03:27 -1000 Subject: [PATCH] Fix test_resample index dtype checking for pandas 2.2 (#15058) I think this got unintentionally fixed in pandas 2.2, but `pandas.testing.assert_series_equal` will be strict about checking a Series's Index's dtype for date-likes. Since pandas always returns `ns` in resample and cudf tries to match the resolution frequency (IMO the better behavior), need to specify `check_index=False` in pandas 2.2 Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: https://github.com/rapidsai/cudf/pull/15058 --- python/cudf/cudf/tests/test_resampling.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/tests/test_resampling.py b/python/cudf/cudf/tests/test_resampling.py index ce0fbbfada8..43f7324affe 100644 --- a/python/cudf/cudf/tests/test_resampling.py +++ b/python/cudf/cudf/tests/test_resampling.py @@ -5,7 +5,7 @@ import pytest import cudf -from cudf.core._compat import PANDAS_GE_200 +from cudf.core._compat import PANDAS_GE_200, PANDAS_GE_220 from cudf.testing._utils import assert_eq @@ -31,6 +31,7 @@ def test_series_downsample_simple(ts_resolution): assert_resample_results_equal( psr.resample("3min").sum(), gsr.resample("3min").sum(), + check_index=not PANDAS_GE_220, ) @@ -43,6 +44,7 @@ def test_series_upsample_simple(): assert_resample_results_equal( psr.resample("3min").sum(), gsr.resample("3min").sum(), + check_index=not PANDAS_GE_220, )