diff --git a/crates/polars-pipe/src/executors/sinks/group_by/aggregates/convert.rs b/crates/polars-pipe/src/executors/sinks/group_by/aggregates/convert.rs index c3bc052d4b2a..dddcac3ba033 100644 --- a/crates/polars-pipe/src/executors/sinks/group_by/aggregates/convert.rs +++ b/crates/polars-pipe/src/executors/sinks/group_by/aggregates/convert.rs @@ -101,7 +101,12 @@ pub fn can_convert_to_hash_agg( } ) && { if let Ok(field) = ae.to_field(input_schema, Context::Default, expr_arena) { - field.dtype.to_physical().is_numeric() + match field.dtype { + DataType::Date => { + matches!(agg_fn, IRAggExpr::Mean(_) | IRAggExpr::Median(_)) + }, + _ => field.dtype.to_physical().is_numeric(), + } } else { false } diff --git a/py-polars/tests/unit/streaming/test_streaming_group_by.py b/py-polars/tests/unit/streaming/test_streaming_group_by.py index 2540cd7c0fd1..db9064c22ec6 100644 --- a/py-polars/tests/unit/streaming/test_streaming_group_by.py +++ b/py-polars/tests/unit/streaming/test_streaming_group_by.py @@ -103,7 +103,7 @@ def test_streaming_group_by_types() -> None: "bool_last": [False], "bool_mean": [0.5], "bool_sum": [1], - "date_sum": [date(2074, 1, 1)], + "date_sum": [None], # Date streaming mean/median has been temporarily disabled # "date_mean": [date(2022, 1, 1)], "date_first": [date(2022, 1, 1)],