Skip to content

Commit 66a2a80

Browse files
add alias mean for UDAF avg
1 parent d163c63 commit 66a2a80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/functions.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ pub fn avg(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
9898
}
9999
}
100100

101+
#[pyfunction]
102+
pub fn mean(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
103+
// alias for avg
104+
avg(expression, distinct)
105+
}
106+
101107
#[pyfunction]
102108
pub fn corr(y: PyExpr, x: PyExpr, distinct: bool) -> PyResult<PyExpr> {
103109
let expr = functions_aggregate::expr_fn::corr(y.expr, x.expr);
@@ -810,7 +816,6 @@ array_fn!(range, start stop step);
810816

811817
aggregate_function!(array_agg, ArrayAgg);
812818
aggregate_function!(max, Max);
813-
aggregate_function!(mean, Avg);
814819
aggregate_function!(min, Min);
815820
aggregate_function!(stddev, Stddev);
816821
aggregate_function!(stddev_pop, StddevPop);

0 commit comments

Comments
 (0)