Skip to content

Commit

Permalink
Fix test_resample index dtype checking for pandas 2.2 (#15058)
Browse files Browse the repository at this point in the history
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: #15058
  • Loading branch information
mroeschke authored Feb 20, 2024
1 parent 44913fc commit 093fe6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/cudf/cudf/tests/test_resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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,
)


Expand All @@ -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,
)


Expand Down

0 comments on commit 093fe6a

Please sign in to comment.