amol- commented on a change in pull request #11624: URL: https://github.com/apache/arrow/pull/11624#discussion_r752402601
########## File path: python/pyarrow/table.pxi ########## @@ -2387,3 +2429,60 @@ def _from_pydict(cls, mapping, schema, metadata): return cls.from_arrays(arrays, schema=schema, metadata=metadata) else: raise TypeError('Schema must be an instance of pyarrow.Schema') + + +class TableGroupBy: + """ + A grouping of columns in a table on which to perform aggregations. + """ + + def __init__(self, table, keys): + if isinstance(keys, str): + keys = [keys] + + self._table = table + self.keys = keys + + def aggregate(self, aggregations): + """ + Perform an aggregation over the grouped columns of the table. + + Parameters + ---------- + aggregations : list[tuple(str, str)] or\ + list[tuple(str, str, FunctionOptions)] Review comment: Uhm, I tested it and it worked on with that indentation. See the attached screenshot (ignore the return type as it was built with also the changes from https://github.com/apache/arrow/pull/11726 in place)  ########## File path: python/pyarrow/table.pxi ########## @@ -2387,3 +2429,60 @@ def _from_pydict(cls, mapping, schema, metadata): return cls.from_arrays(arrays, schema=schema, metadata=metadata) else: raise TypeError('Schema must be an instance of pyarrow.Schema') + + +class TableGroupBy: + """ + A grouping of columns in a table on which to perform aggregations. + """ + + def __init__(self, table, keys): + if isinstance(keys, str): + keys = [keys] + + self._table = table + self.keys = keys + + def aggregate(self, aggregations): + """ + Perform an aggregation over the grouped columns of the table. + + Parameters + ---------- + aggregations : list[tuple(str, str)] or\ + list[tuple(str, str, FunctionOptions)] Review comment: Uhm, I tested it and it worked ok with that indentation. See the attached screenshot (ignore the return type as it was built with also the changes from https://github.com/apache/arrow/pull/11726 in place)  -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org