Skip to content

Commit

Permalink
use assert_eq just like in LogicalPlan.with_new_exprs
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Aug 28, 2024
1 parent 9840b8f commit 1e3ca00
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions datafusion/expr/src/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,7 @@ pub fn transform_sort_vec<F: FnMut(Expr) -> Result<Transformed<Expr>>>(
}

pub fn replace_sort_expressions(sorts: Vec<Sort>, new_expr: Vec<Expr>) -> Vec<Sort> {
if sorts.len() != new_expr.len() {
panic!(
"Incorrect number of new_expr, expected {}, got {}",
sorts.len(),
new_expr.len()
);
}

assert_eq!(sorts.len(), new_expr.len());
let mut new_sorts = Vec::with_capacity(sorts.len());
for (i, expr) in new_expr.into_iter().enumerate() {
new_sorts.push(replace_sort_expression(sorts[i].clone(), expr));
Expand Down

0 comments on commit 1e3ca00

Please sign in to comment.