damccorm commented on code in PR #37672:
URL: https://github.com/apache/beam/pull/37672#discussion_r2850273547
##########
sdks/python/apache_beam/examples/snippets/transforms/aggregation/groupby_attr.py:
##########
@@ -43,22 +43,21 @@
beam.Row(recipe='pie', fruit='blueberry', quantity=1, unit_price=2.00),
beam.Row(recipe='muffin', fruit='blueberry', quantity=2, unit_price=2.00),
beam.Row(recipe='muffin', fruit='banana', quantity=3, unit_price=1.00),
+ beam.Row(recipe='pie', fruit='strawberry', quantity=3, unit_price=1.50),
]
# [END groupby_table]
def groupby_attr(test=None):
with beam.Pipeline() as p:
# [START groupby_attr]
- grouped = (
- p
- | beam.Create(GROCERY_LIST)
- | beam.GroupBy('recipe')
- | beam.Map(print))
+ grouped = (p | beam.Create(GROCERY_LIST) | beam.GroupBy('recipe'))
# [END groupby_attr]
- if test:
- test(grouped)
+ if test:
+ test(grouped)
+ else:
+ grouped | beam.Map(print)
Review Comment:
```suggestion
_ = grouped | beam.Map(print)
```
I think this should fix the linting (it needs to be applied in a bunch of
places)
--
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]