Skip to content

Commit 8a3a606

Browse files
convert median to expr_fn api
Ref apache/datafusion#10644
1 parent 66f25ed commit 8a3a606

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/functions.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ pub fn covar_pop(y: PyExpr, x: PyExpr) -> PyExpr {
4545
functions_aggregate::expr_fn::covar_pop(y.expr, x.expr).into()
4646
}
4747

48+
#[pyfunction]
49+
pub fn median(arg: PyExpr) -> PyExpr {
50+
functions_aggregate::expr_fn::median(arg.expr).into()
51+
}
52+
4853
#[pyfunction]
4954
pub fn covar(y: PyExpr, x: PyExpr) -> PyExpr {
5055
// alias for covar_samp
@@ -583,7 +588,6 @@ aggregate_function!(count, Count);
583588
aggregate_function!(grouping, Grouping);
584589
aggregate_function!(max, Max);
585590
aggregate_function!(mean, Avg);
586-
aggregate_function!(median, Median);
587591
aggregate_function!(min, Min);
588592
aggregate_function!(sum, Sum);
589593
aggregate_function!(stddev, Stddev);

0 commit comments

Comments
 (0)