zhoufek commented on a change in pull request #15603:
URL: https://github.com/apache/beam/pull/15603#discussion_r725290203
##########
File path: sdks/python/apache_beam/transforms/ptransform_test.py
##########
@@ -505,12 +504,10 @@ def test_group_by_key_allow_unsafe_triggers(self):
| beam.Create([(1, 1), (1, 2), (1, 3), (1, 4)])
| WindowInto(
window.GlobalWindows(),
- trigger=trigger.AfterCount(5),
+ trigger=trigger.AfterCount(4),
accumulation_mode=trigger.AccumulationMode.ACCUMULATING)
| beam.GroupByKey())
- # We need five, but it only has four - Displays how this option is
- # dangerous.
- assert_that(pcoll, is_empty())
+ assert_that(pcoll, equal_to([(1, [1, 2, 3, 4])]))
Review comment:
For number 1, we have plenty of tests by now that use it.
For number 2, I added `test_after_count_streaming` to test_trigger.py. I'm
putting it there since it is less about testing GBK when unsafe triggers are
allowed and more about showing `AfterCount` behavior, including its potential
to drop data after firing once.
For number 3, it should be covered by `test_after_count`
[here](https://github.com/apache/beam/blob/2bcfb68483bba88cb1951ed175de60ff848abb28/sdks/python/apache_beam/transforms/trigger_test.py#L578),
but as a comment notes, it's currently only succeeding because of the Direct
Runner bug.
--
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]