diff --git a/python/datafusion/functions.py b/python/datafusion/functions.py index 46d2a2f04..9352db427 100644 --- a/python/datafusion/functions.py +++ b/python/datafusion/functions.py @@ -1294,6 +1294,8 @@ def corr(value1: Expr, value2: Expr, distinct: bool = False) -> Expr: def count(args: Expr | list[Expr] | None = None, distinct: bool = False) -> Expr: """Returns the number of rows that match the given arguments.""" + if args is None: + return count(Expr.literal(1), distinct=distinct) if isinstance(args, list): args = [arg.expr for arg in args] elif isinstance(args, Expr):