|
13 | 13 | import warnings
|
14 | 14 | import cudf.testing.dataset_generator as dataset_generator
|
15 | 15 | from cudf import DataFrame, Series
|
16 |
| -from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140, PANDAS_EQ_200 |
| 16 | +from cudf.core._compat import ( |
| 17 | + PANDAS_GE_150, |
| 18 | + PANDAS_LT_140, |
| 19 | + PANDAS_EQ_200, |
| 20 | + PANDAS_GE_210, |
| 21 | +) |
17 | 22 | from cudf.core.index import DatetimeIndex
|
18 | 23 | from cudf.testing._utils import (
|
19 | 24 | DATETIME_TYPES,
|
@@ -2070,8 +2075,10 @@ def test_first(idx, offset):
|
2070 | 2075 | p = pd.Series(range(len(idx)), dtype="int64", index=idx)
|
2071 | 2076 | g = cudf.from_pandas(p)
|
2072 | 2077 |
|
2073 |
| - expect = p.first(offset=offset) |
2074 |
| - got = g.first(offset=offset) |
| 2078 | + with expect_warning_if(PANDAS_GE_210): |
| 2079 | + expect = p.first(offset=offset) |
| 2080 | + with pytest.warns(FutureWarning): |
| 2081 | + got = g.first(offset=offset) |
2075 | 2082 |
|
2076 | 2083 | assert_eq(expect, got)
|
2077 | 2084 |
|
@@ -2100,8 +2107,10 @@ def test_first_start_at_end_of_month(idx, offset):
|
2100 | 2107 | p = pd.Series(range(len(idx)), index=idx)
|
2101 | 2108 | g = cudf.from_pandas(p)
|
2102 | 2109 |
|
2103 |
| - expect = p.first(offset=offset) |
2104 |
| - got = g.first(offset=offset) |
| 2110 | + with expect_warning_if(PANDAS_GE_210): |
| 2111 | + expect = p.first(offset=offset) |
| 2112 | + with pytest.warns(FutureWarning): |
| 2113 | + got = g.first(offset=offset) |
2105 | 2114 |
|
2106 | 2115 | assert_eq(expect, got)
|
2107 | 2116 |
|
@@ -2137,8 +2146,10 @@ def test_last(idx, offset):
|
2137 | 2146 | p = pd.Series(range(len(idx)), dtype="int64", index=idx)
|
2138 | 2147 | g = cudf.from_pandas(p)
|
2139 | 2148 |
|
2140 |
| - expect = p.last(offset=offset) |
2141 |
| - got = g.last(offset=offset) |
| 2149 | + with expect_warning_if(PANDAS_GE_210): |
| 2150 | + expect = p.last(offset=offset) |
| 2151 | + with pytest.warns(FutureWarning): |
| 2152 | + got = g.last(offset=offset) |
2142 | 2153 |
|
2143 | 2154 | assert_eq(expect, got)
|
2144 | 2155 |
|
|
0 commit comments