@@ -87,26 +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 bool_and ( expression : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
92
- let expr = functions_aggregate:: expr_fn:: bool_and ( expression. expr ) ;
93
- if distinct {
94
- Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
95
- } else {
96
- Ok ( expr. into ( ) )
97
- }
98
- }
99
-
100
- #[ pyfunction]
101
- pub fn bool_or ( expression : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
102
- let expr = functions_aggregate:: expr_fn:: bool_or ( expression. expr ) ;
103
- if distinct {
104
- Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
105
- } else {
106
- Ok ( expr. into ( ) )
107
- }
108
- }
109
-
110
90
#[ pyfunction]
111
91
pub fn corr ( y : PyExpr , x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
112
92
let expr = functions_aggregate:: expr_fn:: corr ( y. expr , x. expr ) ;
@@ -609,6 +589,9 @@ fn window(
609
589
// function and we rely on the wrappers to only use those that
610
590
// are appropriate.
611
591
macro_rules! aggregate_function {
592
+ ( $NAME: ident) => {
593
+ aggregate_function!( $NAME, functions_aggregate:: expr_fn:: $NAME, expr) ;
594
+ } ;
612
595
( $NAME: ident, $FUNC: path) => {
613
596
aggregate_function!( $NAME, $FUNC, expr) ;
614
597
} ;
@@ -851,13 +834,15 @@ array_fn!(array_resize, array size value);
851
834
array_fn ! ( flatten, array) ;
852
835
array_fn ! ( range, start stop step) ;
853
836
854
- aggregate_function ! ( array_agg, functions_aggregate:: array_agg:: array_agg) ;
855
- aggregate_function ! ( max, functions_aggregate:: min_max:: max) ;
856
- aggregate_function ! ( min, functions_aggregate:: min_max:: min) ;
857
- aggregate_function ! ( avg, functions_aggregate:: expr_fn:: avg) ;
858
- aggregate_function ! ( bit_and, functions_aggregate:: expr_fn:: bit_and) ;
859
- aggregate_function ! ( bit_or, functions_aggregate:: expr_fn:: bit_or) ;
860
- aggregate_function ! ( bit_xor, functions_aggregate:: expr_fn:: bit_xor) ;
837
+ aggregate_function ! ( array_agg) ;
838
+ aggregate_function ! ( max) ;
839
+ aggregate_function ! ( min) ;
840
+ aggregate_function ! ( avg) ;
841
+ aggregate_function ! ( bit_and) ;
842
+ aggregate_function ! ( bit_or) ;
843
+ aggregate_function ! ( bit_xor) ;
844
+ aggregate_function ! ( bool_and) ;
845
+ aggregate_function ! ( bool_or) ;
861
846
862
847
fn add_builder_fns_to_window (
863
848
window_fn : Expr ,
0 commit comments