Helper for aggregating on a particular subset of the dataset. This validates the `on` argument, and converts a list of column names to a multi-aggregation. A null `on` results in a multi-aggregation on all columns for an Arrow Dataset, and a single aggregation on the
(
self,
agg_cls: type,
on: Union[str, List[str]],
*args,
**kwargs,
)
| 73 | return Dataset._from_parent(self._dataset, logical_plan) |
| 74 | |
| 75 | def _aggregate_on( |
| 76 | self, |
| 77 | agg_cls: type, |
| 78 | on: Union[str, List[str]], |
| 79 | *args, |
| 80 | **kwargs, |
| 81 | ): |
| 82 | """Helper for aggregating on a particular subset of the dataset. |
| 83 | |
| 84 | This validates the `on` argument, and converts a list of column names |
| 85 | to a multi-aggregation. A null `on` results in a |
| 86 | multi-aggregation on all columns for an Arrow Dataset, and a single |
| 87 | aggregation on the entire row for a simple Dataset. |
| 88 | """ |
| 89 | aggs = self._dataset._build_multicolumn_aggs( |
| 90 | agg_cls, on, *args, skip_cols=self._key, **kwargs |
| 91 | ) |
| 92 | return self.aggregate(*aggs) |
| 93 | |
| 94 | @PublicAPI(api_group=FA_API_GROUP) |
| 95 | def map_groups( |