Implements an accumulator-based aggregation. Args: aggs: Aggregations to do. Returns: The output is an dataset of ``n + 1`` columns where the first column is the groupby key and the second through ``n + 1`` columns are the results of
(self, *aggs: AggregateFn)
| 51 | |
| 52 | @PublicAPI(api_group=FA_API_GROUP) |
| 53 | def aggregate(self, *aggs: AggregateFn) -> Dataset: |
| 54 | """Implements an accumulator-based aggregation. |
| 55 | |
| 56 | Args: |
| 57 | aggs: Aggregations to do. |
| 58 | |
| 59 | Returns: |
| 60 | The output is an dataset of ``n + 1`` columns where the first column |
| 61 | is the groupby key and the second through ``n + 1`` columns are the |
| 62 | results of the aggregations. |
| 63 | If groupby key is ``None`` then the key part of return is omitted. |
| 64 | """ |
| 65 | |
| 66 | op = Aggregate( |
| 67 | key=self._key, |
| 68 | aggs=aggs, |
| 69 | input_dependencies=[self._dataset._logical_plan.dag], |
| 70 | num_partitions=self._num_partitions, |
| 71 | ) |
| 72 | logical_plan = LogicalPlan(op, self._dataset.context) |
| 73 | return Dataset._from_parent(self._dataset, logical_plan) |
| 74 | |
| 75 | def _aggregate_on( |
| 76 | self, |
no test coverage detected