Skip to content

Commit 6001bbf

Browse files
Drop special handling of min_periods for Rolling.count (#13483)
This PR drops a special handling for `Rolling.count` where we always default to `min_periods=0`, this is an inconsistency that pandas-2.0 resolves in: pandas-dev/pandas#48839 This PR fixes 2 pytest failures: ``` = 229 failed, 95769 passed, 2045 skipped, 764 xfailed, 300 xpassed in 458.04s (0:07:38) = ``` On `pandas_2.0_feature_branch`: ``` = 231 failed, 95767 passed, 2045 skipped, 764 xfailed, 300 xpassed in 457.58s (0:07:37) = ```
1 parent a6869e8 commit 6001bbf

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

python/cudf/cudf/core/window/rolling.py

-2
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,6 @@ def _window_to_window_sizes(self, window):
543543
)
544544

545545
def _apply_agg(self, agg_name):
546-
if agg_name == "count" and not self._time_window:
547-
self.min_periods = 0
548546
index = cudf.MultiIndex.from_frame(
549547
cudf.DataFrame(
550548
{

python/cudf/cudf/tests/test_rolling.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import pytest
99

1010
import cudf
11-
from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140
11+
from cudf.core._compat import PANDAS_GE_150, PANDAS_LT_140, PANDAS_GE_200
1212
from cudf.testing._utils import _create_pandas_series, assert_eq
1313
from cudf.testing.dataset_generator import rand_dataframe
1414

1515

1616
@contextmanager
1717
def _hide_pandas_rolling_min_periods_warning(agg):
18-
if agg == "count":
18+
if not PANDAS_GE_200 and agg == "count":
1919
with pytest.warns(
2020
FutureWarning,
2121
match="min_periods=None will default to the size of window "

0 commit comments

Comments
 (0)