polars_plan/dsl/functions/
index.rs1use super::*;
2
3#[cfg(feature = "range")]
9pub fn arg_sort_by<E: AsRef<[Expr]>>(by: E, sort_options: SortMultipleOptions) -> Expr {
10 let e = &by.as_ref()[0];
11 let name = expr_output_name(e).unwrap();
12 int_range(lit(0 as IdxSize), len().cast(IDX_DTYPE), 1, IDX_DTYPE)
13 .sort_by(by, sort_options)
14 .alias(name)
15}
16
17#[cfg(feature = "arg_where")]
18pub fn arg_where<E: Into<Expr>>(condition: E) -> Expr {
20 let condition = condition.into();
21 Expr::Function {
22 input: vec![condition],
23 function: FunctionExpr::ArgWhere,
24 options: FunctionOptions {
25 collect_groups: ApplyOptions::GroupWise,
26 ..Default::default()
27 },
28 }
29}