Skip to content

Commit

Permalink
add alias mean for UDAF avg
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Ward committed Jul 24, 2024
1 parent 6005ff2 commit 136a3c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ pub fn avg(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
}
}

#[pyfunction]
pub fn mean(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
// alias for avg
avg(expression, distinct)
}

#[pyfunction]
pub fn corr(y: PyExpr, x: PyExpr, distinct: bool) -> PyResult<PyExpr> {
let expr = functions_aggregate::expr_fn::corr(y.expr, x.expr);
Expand Down Expand Up @@ -780,7 +786,6 @@ array_fn!(range, start stop step);

aggregate_function!(array_agg, ArrayAgg);
aggregate_function!(max, Max);
aggregate_function!(mean, Avg);
aggregate_function!(min, Min);
aggregate_function!(stddev, Stddev);
aggregate_function!(stddev_pop, StddevPop);
Expand Down

0 comments on commit 136a3c3

Please sign in to comment.