diff --git a/crates/polars-lazy/src/physical_plan/expressions/window.rs b/crates/polars-lazy/src/physical_plan/expressions/window.rs index 94706feec5fb..fd45b2fe7060 100644 --- a/crates/polars-lazy/src/physical_plan/expressions/window.rs +++ b/crates/polars-lazy/src/physical_plan/expressions/window.rs @@ -570,7 +570,7 @@ impl PhysicalExpr for WindowExpr { let df_right = DataFrame::new_no_checks(keys); let df_left = DataFrame::new_no_checks(group_by_columns); private_left_join_multiple_keys( - &df_left, &df_right, None, None, false, + &df_left, &df_right, None, None, true, ) .1 } diff --git a/py-polars/tests/unit/operations/test_window.py b/py-polars/tests/unit/operations/test_window.py index 6483027d1e83..35c566ada53f 100644 --- a/py-polars/tests/unit/operations/test_window.py +++ b/py-polars/tests/unit/operations/test_window.py @@ -424,3 +424,21 @@ def test_window_10417() -> None: pl.col("c") - pl.col("c").mean().over("a"), ] ).collect().to_dict(as_series=False) == {"a": [1], "b": [0.0], "c": [0.0]} + + +def test_window_13173() -> None: + df = pl.DataFrame( + data={ + "color": ["yellow", "yellow"], + "color2": [None, "light"], + "val": ["2", "3"], + } + ) + assert df.with_columns( + pl.min("val").over(["color", "color2"]).alias("min_val_per_color") + ).to_dict(as_series=False) == { + "color": ["yellow", "yellow"], + "color2": [None, "light"], + "val": ["2", "3"], + "min_val_per_color": ["2", "3"], + }