Skip to content

Commit 5fceb9c

Browse files
authored
chore: Remove redundant DSL::AGG::Unique (#27718)
1 parent ff62eb5 commit 5fceb9c

7 files changed

Lines changed: 1 addition & 67 deletions

File tree

crates/polars-plan/dsl-schema-hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"AExprSorted": "aa1099889c36978b22cc2c63dd26ee97581eb5f9e09a6e4f715d972d0cdad2c2",
3-
"AggExpr": "325a77601773d7ff40afe0dff48f8439116051d34555cf3830c831f74b551016",
3+
"AggExpr": "48b4816ce36567b3cf34c359b11fc8265f1bddc0f5b68e23f5981305b5239e7b",
44
"AnonymousColumnsUdf": "5bbddd4f899afa592c318b20bb8d0bdfe2877fa5bf1a63d9cd0da908ac3aec0e",
55
"AnyValue": "2e8929b09f136470ab8b3f200cd05b0e7c167162a3505c84ebd2a7e3da851403",
66
"ArrayDataTypeFunction": "c6089e74d6b54ea7576f21b0bf7d449d60f091243565d245188126f0cd7f1bf6",

crates/polars-plan/src/dsl/expr/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::hash::{Hash, Hasher};
66
pub use anonymous::*;
77
use bytes::Bytes;
88
pub use datatype_fn::*;
9-
use polars_compute::rolling::QuantileMethod;
109
use polars_core::chunked_array::cast::CastOptions;
1110
use polars_core::error::feature_gated;
1211
use polars_core::prelude::*;
@@ -49,12 +48,6 @@ pub enum AggExpr {
4948
input: Arc<Expr>,
5049
include_nulls: bool,
5150
},
52-
// TODO: remove on next DSL break, deprecated in favor of FunctionExpr::Quantile.
53-
Quantile {
54-
expr: Arc<Expr>,
55-
quantile: Arc<Expr>,
56-
method: QuantileMethod,
57-
},
5851
Sum(Arc<Expr>),
5952
AggGroups(Arc<Expr>),
6053
Std(Arc<Expr>, u8),

crates/polars-plan/src/dsl/format.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ impl fmt::Debug for Expr {
185185
} => write!(f, "{input:?}.len()"),
186186
Var(expr, _) => write!(f, "{expr:?}.var()"),
187187
Std(expr, _) => write!(f, "{expr:?}.std()"),
188-
Quantile { expr, .. } => write!(f, "{expr:?}.quantile()"),
189188
}
190189
},
191190
Cast {

crates/polars-plan/src/plans/conversion/dsl_to_ir/expr_expansion.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -389,26 +389,6 @@ fn expand_expression_rec(
389389
},
390390
)?
391391
},
392-
Expr::Agg(AggExpr::Quantile {
393-
expr,
394-
quantile,
395-
method,
396-
}) => {
397-
_ = expand_expression_by_combination(
398-
&[expr.as_ref().clone(), quantile.as_ref().clone()],
399-
ignored_selector_columns,
400-
schema,
401-
out,
402-
opt_flags,
403-
|e| {
404-
Expr::Agg(AggExpr::Quantile {
405-
expr: Arc::new(e[0].clone()),
406-
quantile: Arc::new(e[1].clone()),
407-
method: *method,
408-
})
409-
},
410-
)?
411-
},
412392
Expr::Agg(agg) => {
413393
_ = match agg {
414394
AggExpr::Min {
@@ -576,24 +556,6 @@ fn expand_expression_rec(
576556
opt_flags,
577557
|e| Expr::Agg(AggExpr::Var(Arc::new(e), *ddof)),
578558
)?,
579-
AggExpr::Quantile {
580-
expr,
581-
quantile,
582-
method,
583-
} => expand_expression_by_combination(
584-
&[expr.as_ref().clone(), quantile.as_ref().clone()],
585-
ignored_selector_columns,
586-
schema,
587-
out,
588-
opt_flags,
589-
|e| {
590-
Expr::Agg(AggExpr::Quantile {
591-
expr: Arc::new(e[0].clone()),
592-
quantile: Arc::new(e[1].clone()),
593-
method: *method,
594-
})
595-
},
596-
)?,
597559
}
598560
},
599561
Expr::Ternary {

crates/polars-plan/src/plans/conversion/dsl_to_ir/expr_to_ir.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,6 @@ pub(super) fn to_aexpr_impl(
322322
output_name,
323323
)
324324
},
325-
AggExpr::Quantile {
326-
expr,
327-
quantile,
328-
method,
329-
} => {
330-
// Quantile was moved out from IRAggExpr as it is multi-input.
331-
let expr = to_expr_ir(owned(expr), ctx)?;
332-
let quantile = to_expr_ir(owned(quantile), ctx)?;
333-
let output_name = quantile.output_name().clone();
334-
let function = IRFunctionExpr::Quantile { method };
335-
let aexpr = AExpr::Function {
336-
input: vec![expr, quantile],
337-
options: function.function_options(),
338-
function,
339-
};
340-
return Ok((ctx.arena.add(aexpr), output_name));
341-
},
342325
AggExpr::Sum(input) => {
343326
let (input, output_name) = to_aexpr_mat_lit_arc!(input)?;
344327
(IRAggExpr::Sum(input), output_name)

crates/polars-plan/src/plans/iterator.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ macro_rules! push_expr {
5353
Item { input, .. } => $push($c, input),
5454
Implode { input, .. } => $push($c, input),
5555
Count { input, .. } => $push($c, input),
56-
// TODO: shouldn't quantile push the quantile expr as well?
57-
Quantile { expr, .. } => $push($c, expr),
5856
Sum(e) => $push($c, e),
5957
AggGroups(e) => $push($c, e),
6058
Std(e, _) => $push($c, e),

crates/polars-plan/src/plans/visitor/expr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ impl TreeWalker for Expr {
7171
Mean(x) => Mean(am(x, f)?),
7272
Implode { input, maintain_order } => Implode { input: am(input, f)?, maintain_order },
7373
Count { input, include_nulls } => Count { input: am(input, f)?, include_nulls },
74-
Quantile { expr, quantile, method: interpol } => Quantile { expr: am(expr, &mut f)?, quantile: am(quantile, f)?, method: interpol },
7574
Sum(x) => Sum(am(x, f)?),
7675
AggGroups(x) => AggGroups(am(x, f)?),
7776
Std(x, ddf) => Std(am(x, f)?, ddf),

0 commit comments

Comments
 (0)