Skip to content

Commit

Permalink
test(python): add test for 10417 (pola-rs#10420)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Aug 11, 2023
1 parent b3db64f commit c4ac859
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions py-polars/tests/unit/operations/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,14 @@ def test_window_and_cse_10152() -> None:
)

assert q.collect().columns == ["a", "b", "c"]


def test_window_10417() -> None:
df = pl.DataFrame({"a": [1], "b": [1.2], "c": [2.1]})

assert df.lazy().with_columns(
[
pl.col("b") - pl.col("b").mean().over("a"),
pl.col("c") - pl.col("c").mean().over("a"),
]
).collect().to_dict(False) == {"a": [1], "b": [0.0], "c": [0.0]}

0 comments on commit c4ac859

Please sign in to comment.