diff --git a/ibis/expr/types/groupby.py b/ibis/expr/types/groupby.py index 32bccaa20d7e..3e18946eebb9 100644 --- a/ibis/expr/types/groupby.py +++ b/ibis/expr/types/groupby.py @@ -63,7 +63,7 @@ def __getattr__(self, attr): else: return GroupedArray(field, self) - def aggregate(self, metrics=(), **kwds) -> ir.Table: + def aggregate(self, *metrics, **kwds) -> ir.Table: """Compute aggregates over a group by.""" return self.table.to_expr().aggregate( metrics, by=self.groupings, having=self.havings, **kwds @@ -71,7 +71,7 @@ def aggregate(self, metrics=(), **kwds) -> ir.Table: agg = aggregate - def having(self, expr: ir.BooleanScalar) -> GroupedTable: + def having(self, *expr: ir.BooleanScalar) -> GroupedTable: """Add a post-aggregation result filter `expr`. ::: {.callout-warning} @@ -92,7 +92,7 @@ def having(self, expr: ir.BooleanScalar) -> GroupedTable: havings = tuple(bind(table, expr)) return self.copy(havings=self.havings + havings) - def order_by(self, expr: ir.Value | Iterable[ir.Value]) -> GroupedTable: + def order_by(self, *expr: ir.Value | Iterable[ir.Value]) -> GroupedTable: """Sort a grouped table expression by `expr`. Notes @@ -261,7 +261,7 @@ def count(self) -> ir.Table: The aggregated table """ table = self.table.to_expr() - return table.aggregate([table.count()], by=self.groupings, having=self.havings) + return table.aggregate(table.count(), by=self.groupings, having=self.havings) size = count