From 7e42e6cf58f66cdedd1e94ebbe4a99b8808c3f00 Mon Sep 17 00:00:00 2001 From: Tim Saucer Date: Sat, 7 Sep 2024 09:26:18 -0400 Subject: [PATCH] Move covar_pop and covar_samp to use macro for aggregates --- src/functions.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 038d5289b..8ac8593d5 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -102,16 +102,6 @@ pub fn sum(args: PyExpr) -> PyExpr { functions_aggregate::expr_fn::sum(args.expr).into() } -#[pyfunction] -pub fn covar_samp(y: PyExpr, x: PyExpr) -> PyExpr { - functions_aggregate::expr_fn::covar_samp(y.expr, x.expr).into() -} - -#[pyfunction] -pub fn covar_pop(y: PyExpr, x: PyExpr) -> PyExpr { - functions_aggregate::expr_fn::covar_pop(y.expr, x.expr).into() -} - #[pyfunction] pub fn median(arg: PyExpr) -> PyExpr { functions_aggregate::expr_fn::median(arg.expr).into() @@ -813,6 +803,8 @@ aggregate_function!(bool_and); aggregate_function!(bool_or); aggregate_function!(corr, y x); aggregate_function!(count); +aggregate_function!(covar_samp, y x); +aggregate_function!(covar_pop, y x); fn add_builder_fns_to_window( window_fn: Expr,