damccorm commented on PR #37672:
URL: https://github.com/apache/beam/pull/37672#issuecomment-3946545548

   > @hjtran The PreCommit Python Lint failure is pre-existing and not related 
to this PR. The E265/E501/E111 errors exist across the entire aggregation 
snippets directory and are present on master as well. Running git diff confirms 
none of the failing lint rules were introduced by this PR's changes.
   
   This is incorrect - please look at the linting check output:
   
   ```
   py3-yapf-check: commands[1]> time yapf --diff --parallel --recursive 
apache_beam
   --- 
apache_beam/examples/snippets/transforms/aggregation/groupby_global_aggregate.py
 (original)
   +++ 
apache_beam/examples/snippets/transforms/aggregation/groupby_global_aggregate.py
 (reformatted)
   @@ -48,6 +48,7 @@
    ]
    # [END groupby_table]
    
   +
    def global_aggregate(test=None):
      with beam.Pipeline() as p:
        # [START global_aggregate]
   @@ -65,6 +66,5 @@
          grouped | beam.Map(print)
    
    
   -
    if __name__ == '__main__':
      global_aggregate()
   --- 
apache_beam/examples/snippets/transforms/aggregation/groupby_attr_expr.py       
 (original)
   +++ 
apache_beam/examples/snippets/transforms/aggregation/groupby_attr_expr.py       
 (reformatted)
   @@ -53,8 +53,7 @@
        grouped = (
            p
            | beam.Create(GROCERY_LIST)
   -        | beam.GroupBy('recipe', is_berry=lambda x: 'berry' in x.fruit)
   -    )
   +        | beam.GroupBy('recipe', is_berry=lambda x: 'berry' in x.fruit))
    
        if test:
          test(grouped)
   --- apache_beam/examples/snippets/transforms/aggregation/groupby_expr.py     
(original)
   +++ apache_beam/examples/snippets/transforms/aggregation/groupby_expr.py     
(reformatted)
   @@ -36,6 +36,7 @@
    
    import apache_beam as beam
    
   +
    def groupby_expr(test=None):
      with beam.Pipeline() as p:
        # [START groupby_expr]
   --- apache_beam/examples/snippets/transforms/aggregation/groupby_attr.py     
(original)
   +++ apache_beam/examples/snippets/transforms/aggregation/groupby_attr.py     
(reformatted)
   @@ -47,14 +47,11 @@
    ]
    # [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')
   -    )
   +    grouped = (p | beam.Create(GROCERY_LIST) | beam.GroupBy('recipe'))
        # [END groupby_attr]
    
        if test:
   --- 
apache_beam/examples/snippets/transforms/aggregation/groupby_two_exprs.py       
 (original)
   +++ 
apache_beam/examples/snippets/transforms/aggregation/groupby_two_exprs.py       
 (reformatted)
   @@ -36,17 +36,18 @@
    
    import apache_beam as beam
    
   +
    def groupby_two_exprs(test=None):
      with beam.Pipeline() as p:
        grouped = (
            p
   -        | beam.Create(['strawberry', 'raspberry', 'blueberry', 
'blackberry', 'banana'])
   -        | beam.GroupBy(letter=lambda s: s[0], is_berry=lambda s: 'berry' in 
s)
   -    )
   +        | beam.Create(
   +            ['strawberry', 'raspberry', 'blueberry', 'blackberry', 
'banana'])
   +        | beam.GroupBy(letter=lambda s: s[0], is_berry=lambda s: 'berry' in 
s))
    
        if test:
          test(grouped)
    
   +
    if __name__ == '__main__':
      groupby_two_exprs()
   -
   --- 
apache_beam/examples/snippets/transforms/aggregation/groupby_expr_aggregate.py  
 (original)
   +++ 
apache_beam/examples/snippets/transforms/aggregation/groupby_expr_aggregate.py  
 (reformatted)
   @@ -47,16 +47,16 @@
    ]
    # [END groupby_table]
    
   +
    def expr_aggregate(test=None):
      with beam.Pipeline() as p:
        # [START expr_aggregate]
        grouped = (
            p
            | beam.Create(GROCERY_LIST)
   -        | beam.GroupBy('recipe')
   -            .aggregate_field('quantity', sum, 'total_quantity')
   -            .aggregate_field(lambda x: x.quantity * x.unit_price, sum, 
'price')
   -    )
   +        | beam.GroupBy('recipe').aggregate_field(
   +            'quantity', sum, 'total_quantity').aggregate_field(
   +                lambda x: x.quantity * x.unit_price, sum, 'price'))
        # [END expr_aggregate]
    
        if test:
   Command exited with non-zero status 1
   py3-yapf-check: exit 1 (51.38 seconds) 
/runner/_work/beam/beam/sdks/python/test-suites/tox/pycommon/build/srcs/sdks/python>
 time yapf --diff --parallel --recursive apache_beam pid=1282
   ```
   
   This comes from your changes


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