File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -633,8 +633,22 @@ def aggregate(
633633 ) -> DataFrame :
634634 """Aggregates the rows of the current DataFrame.
635635
636+ By default each unique combination of the ``group_by`` columns
637+ produces one row. To get multiple levels of subtotals in a
638+ single pass, pass a
639+ :py:class:`~datafusion.expr.GroupingSet` expression
640+ (created via
641+ :py:meth:`~datafusion.expr.GroupingSet.rollup`,
642+ :py:meth:`~datafusion.expr.GroupingSet.cube`, or
643+ :py:meth:`~datafusion.expr.GroupingSet.grouping_sets`)
644+ as the ``group_by`` argument. See the
645+ :ref:`aggregation` user guide for detailed examples.
646+
636647 Args:
637- group_by: Sequence of expressions or column names to group by.
648+ group_by: Sequence of expressions or column names to group
649+ by. A :py:class:`~datafusion.expr.GroupingSet`
650+ expression may be included to produce multiple grouping
651+ levels (rollup, cube, or explicit grouping sets).
638652 aggs: Sequence of expressions to aggregate.
639653
640654 Returns:
You can’t perform that action at this time.
0 commit comments