@@ -583,23 +583,13 @@ fn col(name: &str) -> PyResult<PyExpr> {
583
583
} )
584
584
}
585
585
586
- // TODO: do we want to create an equivalent?
587
- // /// Create a COUNT(1) aggregate expression
588
- // #[pyfunction]
589
- // fn count_star() -> PyResult<PyExpr> {
590
- // Ok(PyExpr {
591
- // expr: Expr::AggregateFunction(AggregateFunction {
592
- // func_def: datafusion_expr::expr::AggregateFunctionDefinition::BuiltIn(
593
- // aggregate_function::AggregateFunction::Count,
594
- // ),
595
- // args: vec![lit(1)],
596
- // distinct: false,
597
- // filter: None,
598
- // order_by: None,
599
- // null_treatment: None,
600
- // }),
601
- // })
602
- // }
586
+ // TODO: should we just expose this in python?
587
+ /// Create a COUNT(1) aggregate expression
588
+ #[ pyfunction]
589
+ fn count_star ( ) -> PyExpr {
590
+ functions_aggregate:: expr_fn:: count ( lit ( 1 ) ) . into ( )
591
+
592
+ }
603
593
604
594
/// Wrapper for [`functions_aggregate::expr_fn::count`]
605
595
/// Count the number of non-null values in the column
@@ -1030,7 +1020,7 @@ pub(crate) fn init_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
1030
1020
m. add_wrapped ( wrap_pyfunction ! ( cosh) ) ?;
1031
1021
m. add_wrapped ( wrap_pyfunction ! ( cot) ) ?;
1032
1022
m. add_wrapped ( wrap_pyfunction ! ( count) ) ?;
1033
- // m.add_wrapped(wrap_pyfunction!(count_star))?;
1023
+ m. add_wrapped ( wrap_pyfunction ! ( count_star) ) ?;
1034
1024
m. add_wrapped ( wrap_pyfunction ! ( covar) ) ?;
1035
1025
m. add_wrapped ( wrap_pyfunction ! ( covar_pop) ) ?;
1036
1026
m. add_wrapped ( wrap_pyfunction ! ( covar_samp) ) ?;
0 commit comments