diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi index 30350109ee436..27ef3e6a1a21b 100644 --- a/python/pyarrow/table.pxi +++ b/python/pyarrow/table.pxi @@ -5387,5 +5387,5 @@ list[tuple(str, str, FunctionOptions)] return _pc()._group_by( [self._table[c] for c in columns], [self._table[k] for k in self.keys], - group_by_aggrs + group_by_aggrs ).rename_columns(column_names) diff --git a/python/pyarrow/tests/test_table.py b/python/pyarrow/tests/test_table.py index ef8a507581d96..3b8e928501e34 100644 --- a/python/pyarrow/tests/test_table.py +++ b/python/pyarrow/tests/test_table.py @@ -2024,8 +2024,11 @@ def sorted_by_keys(d): "values_count": [1] } - table = pa.table({'keys': ['a', 'b', 'a', 'b', 'a', 'b'], 'values': range(6)}) - table_with_chunks = pa.Table.from_batches(table.to_batches(max_chunksize=3)) + table = pa.table({ + 'keys': ['a', 'b', 'a', 'b', 'a', 'b'], + 'values': range(6)}) + table_with_chunks = pa.Table.from_batches( + table.to_batches(max_chunksize=3)) r = table_with_chunks.group_by('keys').aggregate([('values', 'sum')]) print(r) assert sorted_by_keys(r.to_pydict()) == { @@ -2033,6 +2036,7 @@ def sorted_by_keys(d): "values_sum": [6, 9] } + def test_table_to_recordbatchreader(): table = pa.Table.from_pydict({'x': [1, 2, 3]}) reader = table.to_reader()