[ https://issues.apache.org/jira/browse/BEAM-8575?focusedWorklogId=369538&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-369538 ]
ASF GitHub Bot logged work on BEAM-8575: ---------------------------------------- Author: ASF GitHub Bot Created on: 10/Jan/20 01:48 Start Date: 10/Jan/20 01:48 Worklog Time Spent: 10m Work Description: bumblebee-coming commented on pull request #10190: [BEAM-8575] Added two unit tests to CombineTest class to test that Co… URL: https://github.com/apache/beam/pull/10190#discussion_r365041530 ########## File path: sdks/python/apache_beam/transforms/combiners_test.py ########## @@ -485,6 +520,113 @@ def test_fixed_windows_combine(self): equal_to([('c', 3), ('c', 10), ('d', 5), ('d', 17)]), label='sum per key') + # Test that three different kinds of metrics work with a customized + # CounterIncrememtingCombineFn. + def test_custormized_counters_in_combine_fn(self): + p = TestPipeline() + input = (p + | beam.Create([('c', 'i'), + ('c', 'go'), + ('c', 'run'), + ('d', 'beam'), + ('d', 'tests')])) + + # The result of concatenating all values regardless of key. + global_concat = (input + | beam.Values() + | beam.CombineGlobally(CounterIncrememtingCombineFn()) + | "sort global result" >> _SortLists) + + # The (key, concatenated_string) pairs for all keys. + concat_per_key = (input + | beam.CombinePerKey(CounterIncrememtingCombineFn()) + | "sort per key result" >> _SortLists) + + result = p.run() + result.wait_until_finish() + + # Verify the concatenated strings are correct. + expected_concat_per_key = [('c', 'ginoru'), ('d', 'abeemsstt')] Review comment: Done. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 369538) Time Spent: 45h 10m (was: 45h) > Add more Python validates runner tests > -------------------------------------- > > Key: BEAM-8575 > URL: https://issues.apache.org/jira/browse/BEAM-8575 > Project: Beam > Issue Type: Test > Components: sdk-py-core, testing > Reporter: wendy liu > Assignee: wendy liu > Priority: Major > Time Spent: 45h 10m > Remaining Estimate: 0h > > This is the umbrella issue to track the work of adding more Python tests to > improve test coverage. -- This message was sent by Atlassian Jira (v8.3.4#803005)