Skip to content

Commit

Permalink
Small bugfix. When arguments are None, we should use count_star
Browse files Browse the repository at this point in the history
  • Loading branch information
timsaucer committed Jul 24, 2024
1 parent f00b8ee commit 5cabf83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/datafusion/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 Expr(f.count_star())
if isinstance(args, list):
args = [arg.expr for arg in args]
elif isinstance(args, Expr):
Expand Down

0 comments on commit 5cabf83

Please sign in to comment.