diff --git a/crates/polars-lazy/src/physical_plan/planner/expr.rs b/crates/polars-lazy/src/physical_plan/planner/expr.rs index 2411539969d0..04cc5feb20bf 100644 --- a/crates/polars-lazy/src/physical_plan/planner/expr.rs +++ b/crates/polars-lazy/src/physical_plan/planner/expr.rs @@ -95,7 +95,6 @@ pub(crate) fn create_physical_expr( Window { mut function, partition_by, - order_by: _, options, } => { state.set_window(); diff --git a/crates/polars-plan/src/dsl/expr.rs b/crates/polars-plan/src/dsl/expr.rs index 18eecfe055e5..5a640b6458d4 100644 --- a/crates/polars-plan/src/dsl/expr.rs +++ b/crates/polars-plan/src/dsl/expr.rs @@ -120,7 +120,6 @@ pub enum Expr { /// Also has the input. i.e. avg("foo") function: Box, partition_by: Vec, - order_by: Option>, options: WindowOptions, }, Wildcard, diff --git a/crates/polars-plan/src/dsl/mod.rs b/crates/polars-plan/src/dsl/mod.rs index 87e6f8c3f624..18667e1d1fe6 100644 --- a/crates/polars-plan/src/dsl/mod.rs +++ b/crates/polars-plan/src/dsl/mod.rs @@ -946,7 +946,6 @@ impl Expr { Expr::Window { function: Box::new(self), partition_by, - order_by: None, options, } } diff --git a/crates/polars-plan/src/logical_plan/aexpr/mod.rs b/crates/polars-plan/src/logical_plan/aexpr/mod.rs index 67553c2e0084..cf450130eec1 100644 --- a/crates/polars-plan/src/logical_plan/aexpr/mod.rs +++ b/crates/polars-plan/src/logical_plan/aexpr/mod.rs @@ -178,7 +178,6 @@ pub enum AExpr { Window { function: Node, partition_by: Vec, - order_by: Option, options: WindowOptions, }, #[default] @@ -314,15 +313,11 @@ impl AExpr { Window { function, partition_by, - order_by, options: _, } => { for e in partition_by.iter().rev() { container.push(*e); } - if let Some(e) = order_by { - container.push(*e); - } // latest so that it is popped first container.push(*function); }, @@ -398,14 +393,12 @@ impl AExpr { Window { function, partition_by, - order_by, .. } => { *function = *inputs.last().unwrap(); partition_by.clear(); partition_by.extend_from_slice(&inputs[..inputs.len() - 1]); - assert!(order_by.is_none()); return self; }, }; diff --git a/crates/polars-plan/src/logical_plan/conversion.rs b/crates/polars-plan/src/logical_plan/conversion.rs index 71d40564ec02..33be2b1782dc 100644 --- a/crates/polars-plan/src/logical_plan/conversion.rs +++ b/crates/polars-plan/src/logical_plan/conversion.rs @@ -128,12 +128,10 @@ pub fn to_aexpr(expr: Expr, arena: &mut Arena) -> Node { Expr::Window { function, partition_by, - order_by, options, } => AExpr::Window { function: to_aexpr(*function, arena), partition_by: to_aexprs(partition_by, arena), - order_by: order_by.map(|ob| to_aexpr(*ob, arena)), options, }, Expr::Slice { @@ -565,16 +563,13 @@ pub fn node_to_expr(node: Node, expr_arena: &Arena) -> Expr { AExpr::Window { function, partition_by, - order_by, options, } => { let function = Box::new(node_to_expr(function, expr_arena)); let partition_by = nodes_to_exprs(&partition_by, expr_arena); - let order_by = order_by.map(|ob| Box::new(node_to_expr(ob, expr_arena))); Expr::Window { function, partition_by, - order_by, options, } }, diff --git a/crates/polars-plan/src/logical_plan/iterator.rs b/crates/polars-plan/src/logical_plan/iterator.rs index adb333804b35..2e90462a4da7 100644 --- a/crates/polars-plan/src/logical_plan/iterator.rs +++ b/crates/polars-plan/src/logical_plan/iterator.rs @@ -68,15 +68,11 @@ macro_rules! push_expr { Window { function, partition_by, - order_by, .. } => { for e in partition_by.into_iter().rev() { $push(e) } - if let Some(e) = order_by { - $push(e); - } // latest so that it is popped first $push(function); },