tvalentyn commented on code in PR #23224:
URL: https://github.com/apache/beam/pull/23224#discussion_r988335935


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -4061,6 +4203,18 @@ purchases.apply(Group.byFieldNames("userId")
     .aggregateField("costCents", Top.<Long>largestLongsFn(10), 
"topPurchases"));
 {{< /highlight >}}
 
+{{< highlight python >}}
+input_pc = ... # {"user_id": ...,"item_Id": ..., "cost_cents": ...}
+output_pc = input_pc | beam.GroupBy("user_id")
+       .aggregate_field("item_id",count,"num_purchases")
+       .aggregate_field("cost_cents",sum,"total_spendcents")

Review Comment:
   there is 
https://github.com/apache/beam/blob/master/sdks/python/apache_beam/transforms/combiners.py#L158
 , but I am not sure what exactly is needed to 'expose' this CombineFn - 
perhaps you could file a FR @TheNeuralBit ?



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