@@ -191,6 +191,96 @@ pub fn var_pop(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
191191 }
192192}
193193
194+ #[ pyfunction]
195+ pub fn regr_avgx ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
196+ let expr = functions_aggregate:: expr_fn:: regr_avgx ( expr_y. expr , expr_x. expr ) ;
197+ if distinct {
198+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
199+ } else {
200+ Ok ( expr. into ( ) )
201+ }
202+ }
203+
204+ #[ pyfunction]
205+ pub fn regr_avgy ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
206+ let expr = functions_aggregate:: expr_fn:: regr_avgy ( expr_y. expr , expr_x. expr ) ;
207+ if distinct {
208+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
209+ } else {
210+ Ok ( expr. into ( ) )
211+ }
212+ }
213+
214+ #[ pyfunction]
215+ pub fn regr_count ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
216+ let expr = functions_aggregate:: expr_fn:: regr_count ( expr_y. expr , expr_x. expr ) ;
217+ if distinct {
218+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
219+ } else {
220+ Ok ( expr. into ( ) )
221+ }
222+ }
223+
224+ #[ pyfunction]
225+ pub fn regr_intercept ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
226+ let expr = functions_aggregate:: expr_fn:: regr_intercept ( expr_y. expr , expr_x. expr ) ;
227+ if distinct {
228+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
229+ } else {
230+ Ok ( expr. into ( ) )
231+ }
232+ }
233+
234+ #[ pyfunction]
235+ pub fn regr_r2 ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
236+ let expr = functions_aggregate:: expr_fn:: regr_r2 ( expr_y. expr , expr_x. expr ) ;
237+ if distinct {
238+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
239+ } else {
240+ Ok ( expr. into ( ) )
241+ }
242+ }
243+
244+ #[ pyfunction]
245+ pub fn regr_slope ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
246+ let expr = functions_aggregate:: expr_fn:: regr_slope ( expr_y. expr , expr_x. expr ) ;
247+ if distinct {
248+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
249+ } else {
250+ Ok ( expr. into ( ) )
251+ }
252+ }
253+
254+ #[ pyfunction]
255+ pub fn regr_sxx ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
256+ let expr = functions_aggregate:: expr_fn:: regr_sxx ( expr_y. expr , expr_x. expr ) ;
257+ if distinct {
258+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
259+ } else {
260+ Ok ( expr. into ( ) )
261+ }
262+ }
263+
264+ #[ pyfunction]
265+ pub fn regr_sxy ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
266+ let expr = functions_aggregate:: expr_fn:: regr_sxy ( expr_y. expr , expr_x. expr ) ;
267+ if distinct {
268+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
269+ } else {
270+ Ok ( expr. into ( ) )
271+ }
272+ }
273+
274+ #[ pyfunction]
275+ pub fn regr_syy ( expr_y : PyExpr , expr_x : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
276+ let expr = functions_aggregate:: expr_fn:: regr_syy ( expr_y. expr , expr_x. expr ) ;
277+ if distinct {
278+ Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
279+ } else {
280+ Ok ( expr. into ( ) )
281+ }
282+ }
283+
194284#[ pyfunction]
195285#[ pyo3( signature = ( expr, distinct = false , filter = None , order_by = None , null_treatment = None ) ) ]
196286pub fn first_value (
@@ -847,15 +937,6 @@ array_fn!(range, start stop step);
847937aggregate_function ! ( array_agg, ArrayAgg ) ;
848938aggregate_function ! ( max, Max ) ;
849939aggregate_function ! ( min, Min ) ;
850- aggregate_function ! ( regr_avgx, RegrAvgx ) ;
851- aggregate_function ! ( regr_avgy, RegrAvgy ) ;
852- aggregate_function ! ( regr_count, RegrCount ) ;
853- aggregate_function ! ( regr_intercept, RegrIntercept ) ;
854- aggregate_function ! ( regr_r2, RegrR2 ) ;
855- aggregate_function ! ( regr_slope, RegrSlope ) ;
856- aggregate_function ! ( regr_sxx, RegrSXX ) ;
857- aggregate_function ! ( regr_sxy, RegrSXY ) ;
858- aggregate_function ! ( regr_syy, RegrSYY ) ;
859940aggregate_function ! ( bit_and, BitAnd ) ;
860941aggregate_function ! ( bit_or, BitOr ) ;
861942aggregate_function ! ( bit_xor, BitXor ) ;
0 commit comments