kennknowles commented on a change in pull request #15603:
URL: https://github.com/apache/beam/pull/15603#discussion_r723705851



##########
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:
       You ought to be able to get output from `AfterCount(5)`, right?

##########
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:
       Yea it sounds like it. We would benefit from:
   
   1. Test of an unsafe trigger that does fire, confirming it is allowed and 
works.
   2. Test of unsafe trigger dropping subsequent data (less important to test)
   3. Test of arbitrary trigger (doesn't matter which kind) that never fires 
but still on GC the elements come out.




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