diff --git a/crates/polars-plan/src/plans/aexpr/schema.rs b/crates/polars-plan/src/plans/aexpr/schema.rs index 0e6fa368321c..e273c1818f35 100644 --- a/crates/polars-plan/src/plans/aexpr/schema.rs +++ b/crates/polars-plan/src/plans/aexpr/schema.rs @@ -369,9 +369,6 @@ impl AExpr { polars_ensure!(!fields.is_empty(), ComputeError: "expression: '{}' didn't get any inputs", function); let out = function.get_field(ctx.schema, ctx.ctx, &fields)?; - // Note: Here in schema resolution we use `is_elementwise()`. During execution the - // scalar returns are identified using `is_scalar_ae()` - if options.flags.contains(FunctionFlags::RETURNS_SCALAR) { *agg_list = false; } else if !options.is_elementwise() && matches!(ctx.ctx, Context::Aggregation) {