From ebeeea7d5d8aff4d7797a7faf53c50053f5c9fc4 Mon Sep 17 00:00:00 2001 From: Kevin Trebing Date: Thu, 31 Oct 2024 18:02:01 +0100 Subject: [PATCH] test(python): Fix `test_rolling_by_integer` not using parameterized dtype (#19555) Co-authored-by: HansBambel --- py-polars/tests/unit/operations/rolling/test_rolling.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py-polars/tests/unit/operations/rolling/test_rolling.py b/py-polars/tests/unit/operations/rolling/test_rolling.py index be88328ae40b..8f0cbafe52fb 100644 --- a/py-polars/tests/unit/operations/rolling/test_rolling.py +++ b/py-polars/tests/unit/operations/rolling/test_rolling.py @@ -822,7 +822,11 @@ def test_rolling_by_date() -> None: @pytest.mark.parametrize("dtype", [pl.Int64, pl.Int32, pl.UInt64, pl.UInt32]) def test_rolling_by_integer(dtype: PolarsDataType) -> None: - df = pl.DataFrame({"val": [1, 2, 3]}).with_row_index() + df = ( + pl.DataFrame({"val": [1, 2, 3]}) + .with_row_index() + .with_columns(pl.col("index").cast(dtype)) + ) result = df.with_columns(roll=pl.col("val").rolling_sum_by("index", "2i")) expected = df.with_columns(roll=pl.Series([1, 3, 5])) assert_frame_equal(result, expected)