westonpace commented on code in PR #14867:
URL: https://github.com/apache/arrow/pull/14867#discussion_r1043947935
##########
python/pyarrow/_compute.pyx:
##########
@@ -2211,11 +2213,18 @@ def _group_by(args, keys, aggregations):
c_aggregations.push_back(c_aggr)
with nogil:
- result = GetResultValue(
+ c_agg_batches = GetResultValue(
GroupBy(c_args, c_keys, c_aggregations)
)
- return wrap_datum(result)
+ result_batches = []
+ for c_batch in c_agg_batches:
+ result_batch = []
+ for c_column in c_batch.values:
+ result_batch.append(wrap_datum(c_column))
+ result_batches.append(result_batch)
Review Comment:
Ok, I ended up promoting `arrow::compute::GroupBy` to a "proper" convenience
function. It now accepts arrays, returns a table, is a bit friendlier with
field names, checks for invalid input, is added to the api.h file, and has unit
tests.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]