Skip to content

Commit

Permalink
refactor: Don't enter streaming engine for groupby-> agg mean/median … (
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored and Wouittone committed Jun 22, 2024
1 parent 7307448 commit 67e0af3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/streaming/test_streaming_group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
Expand Down

0 comments on commit 67e0af3

Please sign in to comment.