jorisvandenbossche commented on code in PR #14867:
URL: https://github.com/apache/arrow/pull/14867#discussion_r1041924193


##########
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:
   Could this use the `ExecBatch::ToRecordBatch` to return a list of batches 
instead? (that seems simpler to work with, and also simplifies the code here)



-- 
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]

Reply via email to