Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
westonpace committed Jan 4, 2023
1 parent 5f71dd9 commit 9e71dc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/pyarrow/table.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 6 additions & 2 deletions python/pyarrow/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,15 +2024,19 @@ 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()) == {
"keys": ["a", "b"],
"values_sum": [6, 9]
}


def test_table_to_recordbatchreader():
table = pa.Table.from_pydict({'x': [1, 2, 3]})
reader = table.to_reader()
Expand Down

0 comments on commit 9e71dc2

Please sign in to comment.