amol- commented on pull request #11624:
URL: https://github.com/apache/arrow/pull/11624#issuecomment-967271625


   > Another possibility is to have a two_step API, e.g. replace:
   > 
   > ```python
   > table.group_by("keys", ["values"], "sum")
   > ```
   > 
   > with:
   > 
   > ```python
   > table.group_by("keys", ["values"]).aggregate("sum")
   > ```
   > 
   > or perhaps even some shortcuts:
   > 
   > ```python
   > table.group_by("keys", ["values"]).sum()
   > ```
   > 
   
   I think that in such case the aggregated values shouldn't go into 
`group_by`, you probably would want something like 
`table.group_by("keys").sum("values").max("othervalues", HashMaxOptions())`
   I'm not too fond of that solution by the way as it would require an explicit 
point where you collect results to allow chaining multiple aggregations. 
   
   I think having a single `aggregate` method where you can provide multiple 
aggregations would be more usable
   ```
   t.group_by("key").aggregate([
      ("sum", "values"),
      ("max", "othervalues", HashMaxOptions())
   ])
   ```
   


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