MansiSingh17 opened a new pull request, #37672:
URL: https://github.com/apache/beam/pull/37672

   Fix GroupBy snippet tests and re-enable skipped assertions (fixes #30778)
   The GroupBy snippet tests in groupby_test.py were permanently skipped via 
skip_due_to_30778 = True. This PR fixes the underlying issues in the snippet 
files so all 7 tests pass.
   Root causes fixed:
   
   Missing strawberry entry in GROCERY_LIST across all snippet files caused 
incorrect aggregate results
   if test block was outside the with beam.Pipeline() context, making grouped 
inaccessible
   beam.Map(print) was chained inside the pipeline, polluting the snippet and 
breaking test assertions
   check_simple_aggregate_result was applying beam.MapTuple(normalize_kv) to 
Row objects returned by aggregate_field, which expects KV pairs
   
   Files changed:
   
   groupby_attr.py
   groupby_attr_expr.py
   groupby_expr.py
   groupby_expr_aggregate.py
   groupby_global_aggregate.py
   groupby_simple_aggregate.py
   groupby_two_exprs.py
   groupby_test.py
   
   Testing:
   pytest -q 
sdks/python/apache_beam/examples/snippets/transforms/aggregation/groupby_test.py
   7 passed in 0.99s
   
   
    addresses #30778
    Update CHANGES.md with noteworthy 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