Michael-J-Ward commented on code in PR #771: URL: https://github.com/apache/datafusion-python/pull/771#discussion_r1693040247
########## src/functions.rs: ########## @@ -293,21 +569,23 @@ fn col(name: &str) -> PyResult<PyExpr> { }) } +// TODO: should we just expose this in python? /// Create a COUNT(1) aggregate expression #[pyfunction] -fn count_star() -> PyResult<PyExpr> { - Ok(PyExpr { - expr: Expr::AggregateFunction(AggregateFunction { - func_def: datafusion_expr::expr::AggregateFunctionDefinition::BuiltIn( - aggregate_function::AggregateFunction::Count, - ), - args: vec![lit(1)], - distinct: false, - filter: None, - order_by: None, - null_treatment: None, - }), - }) +fn count_star() -> PyExpr { + functions_aggregate::expr_fn::count(lit(1)).into() +} + Review Comment: Should I add that to the `functions.rs` module docs and/or somewhere in the contributor guide? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org