@@ -432,25 +432,6 @@ fn col(name: &str) -> PyResult<PyExpr> {
432432 } )
433433}
434434
435- // TODO: should we just expose this in python?
436- /// Create a COUNT(1) aggregate expression
437- #[ pyfunction]
438- fn count_star ( ) -> PyExpr {
439- functions_aggregate:: expr_fn:: count ( lit ( 1 ) ) . into ( )
440- }
441-
442- /// Wrapper for [`functions_aggregate::expr_fn::count`]
443- /// Count the number of non-null values in the column
444- #[ pyfunction]
445- fn count ( expr : PyExpr , distinct : bool ) -> PyResult < PyExpr > {
446- let expr = functions_aggregate:: expr_fn:: count ( expr. expr ) ;
447- if distinct {
448- Ok ( expr. distinct ( ) . build ( ) ?. into ( ) )
449- } else {
450- Ok ( expr. into ( ) )
451- }
452- }
453-
454435/// Create a CASE WHEN statement with literal WHEN expressions for comparison to the base expression.
455436#[ pyfunction]
456437fn case ( expr : PyExpr ) -> PyResult < PyCaseBuilder > {
@@ -830,6 +811,7 @@ aggregate_function!(bit_xor);
830811aggregate_function ! ( bool_and) ;
831812aggregate_function ! ( bool_or) ;
832813aggregate_function ! ( corr, y x) ;
814+ aggregate_function ! ( count) ;
833815
834816fn add_builder_fns_to_window (
835817 window_fn : Expr ,
@@ -978,7 +960,6 @@ pub(crate) fn init_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
978960 m. add_wrapped ( wrap_pyfunction ! ( cosh) ) ?;
979961 m. add_wrapped ( wrap_pyfunction ! ( cot) ) ?;
980962 m. add_wrapped ( wrap_pyfunction ! ( count) ) ?;
981- m. add_wrapped ( wrap_pyfunction ! ( count_star) ) ?;
982963 m. add_wrapped ( wrap_pyfunction ! ( covar_pop) ) ?;
983964 m. add_wrapped ( wrap_pyfunction ! ( covar_samp) ) ?;
984965 m. add_wrapped ( wrap_pyfunction ! ( current_date) ) ?;
0 commit comments