From de9b99aafd016d7657854715a15f6451760ccd8e Mon Sep 17 00:00:00 2001 From: coastalwhite Date: Wed, 8 Jan 2025 10:21:46 +0100 Subject: [PATCH] check e.is_scalar --- crates/polars-expr/src/expressions/sortby.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/polars-expr/src/expressions/sortby.rs b/crates/polars-expr/src/expressions/sortby.rs index 0f4cb05057e4..a60ff81c11c6 100644 --- a/crates/polars-expr/src/expressions/sortby.rs +++ b/crates/polars-expr/src/expressions/sortby.rs @@ -239,7 +239,7 @@ impl PhysicalExpr for SortByExpr { if broadcast_length != column.len() { polars_ensure!( - broadcast_length == 1, + broadcast_length == 1 && e.is_scalar(), expr = self.expr, ShapeMismatch: "`sort_by` produced different length ({}) than earlier Series' length in `by` ({})", broadcast_length, column.len()