Skip to content

Commit

Permalink
propagate scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
reswqa committed Apr 12, 2024
1 parent 4085dd5 commit d59c930
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/polars-lazy/src/physical_plan/expressions/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ impl ApplyExpr {
ca: ListChunked,
) -> PolarsResult<AggregationContext<'a>> {
let all_unit_len = all_unit_length(&ca);
if all_unit_len && self.returns_scalar {
if all_unit_len
&& (self.returns_scalar || matches!(ac.state, AggState::AggregatedScalar(_)))
{
ac.with_agg_state(AggState::AggregatedScalar(
ca.explode().unwrap().into_series(),
));
Expand Down

0 comments on commit d59c930

Please sign in to comment.