File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,16 @@ pub fn avg(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
9898 }
9999}
100100
101+ #[ pyfunction]
102+ pub fn corr ( y : PyExpr , x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
103+ let expr = functions_aggregate:: expr_fn:: corr ( y. expr , x. expr ) ;
104+ if distinct {
105+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
106+ } else {
107+ Ok ( expr. into ( ) )
108+ }
109+ }
110+
101111#[ pyfunction]
102112pub fn sum ( args : PyExpr ) -> PyExpr {
103113 functions_aggregate:: expr_fn:: sum ( args. expr ) . into ( )
@@ -789,7 +799,6 @@ array_fn!(flatten, array);
789799array_fn ! ( range, start stop step) ;
790800
791801aggregate_function ! ( array_agg, ArrayAgg ) ;
792- aggregate_function ! ( corr, Correlation ) ;
793802aggregate_function ! ( grouping, Grouping ) ;
794803aggregate_function ! ( max, Max ) ;
795804aggregate_function ! ( mean, Avg ) ;
You can’t perform that action at this time.
0 commit comments