@@ -87,16 +87,6 @@ pub fn approx_percentile_cont_with_weight(
87
87
add_builder_fns_to_aggregate ( agg_fn, None , filter, None , None )
88
88
}
89
89
90
- #[ pyfunction]
91
- pub fn corr ( y : PyExpr , x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
92
- let expr = functions_aggregate:: expr_fn:: corr ( y. expr , x. expr ) ;
93
- if distinct {
94
- Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
95
- } else {
96
- Ok ( expr. into ( ) )
97
- }
98
- }
99
-
100
90
#[ pyfunction]
101
91
pub fn grouping ( expression : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
102
92
let expr = functions_aggregate:: expr_fn:: grouping ( expression. expr ) ;
@@ -590,12 +580,9 @@ fn window(
590
580
// are appropriate.
591
581
macro_rules! aggregate_function {
592
582
( $NAME: ident) => {
593
- aggregate_function!( $NAME, functions_aggregate:: expr_fn:: $NAME, expr) ;
594
- } ;
595
- ( $NAME: ident, $FUNC: path) => {
596
- aggregate_function!( $NAME, $FUNC, expr) ;
583
+ aggregate_function!( $NAME, expr) ;
597
584
} ;
598
- ( $NAME: ident, $FUNC : path , $ ( $arg: ident) * ) => {
585
+ ( $NAME: ident, $( $arg: ident) * ) => {
599
586
#[ pyfunction]
600
587
fn $NAME(
601
588
$( $arg: PyExpr ) ,* ,
@@ -604,7 +591,7 @@ macro_rules! aggregate_function {
604
591
order_by: Option <Vec <PyExpr >>,
605
592
null_treatment: Option <NullTreatment >
606
593
) -> PyResult <PyExpr > {
607
- let agg_fn = $FUNC ( $( $arg. into( ) ) ,* ) ;
594
+ let agg_fn = functions_aggregate :: expr_fn :: $NAME ( $( $arg. into( ) ) ,* ) ;
608
595
609
596
add_builder_fns_to_aggregate( agg_fn, distinct, filter, order_by, null_treatment)
610
597
}
@@ -843,6 +830,7 @@ aggregate_function!(bit_or);
843
830
aggregate_function ! ( bit_xor) ;
844
831
aggregate_function ! ( bool_and) ;
845
832
aggregate_function ! ( bool_or) ;
833
+ aggregate_function ! ( corr, y x) ;
846
834
847
835
fn add_builder_fns_to_window (
848
836
window_fn : Expr ,
0 commit comments