Skip to content

Commit

Permalink
test(python): Fix test_rolling_by_integer not using parameterized d…
Browse files Browse the repository at this point in the history
…type (#19555)

Co-authored-by: HansBambel <[email protected]>
  • Loading branch information
HansBambel and HansBambel authored Oct 31, 2024
1 parent 6c88c48 commit ebeeea7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py-polars/tests/unit/operations/rolling/test_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ebeeea7

Please sign in to comment.