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



##########
File path: sdks/python/apache_beam/transforms/trigger.py
##########
@@ -833,13 +839,12 @@ class AfterAny(_ParallelTriggerFn):
   combine_op = any
 
   def may_lose_data(self, windowing):
-    reason = DataLossReason.NO_POTENTIAL_LOSS
-    for trigger in self.triggers:
-      t_reason = trigger.may_lose_data(windowing)
-      if t_reason == DataLossReason.NO_POTENTIAL_LOSS:
-        return t_reason
-      reason |= t_reason
-    return reason
+    """If any sub-trigger may finish, this one may finish."""

Review comment:
       `AfterAny` behaves similarly to `AfterAll` but uses Python's `any` for 
its combine operation, so it's still possible that `AfterAny` will never 
finish. For instance, `AfterAny(DefaultTrigger(), Repeatedly(AfterCount(50)))` 
has the three following possibly inputs to `any`:
   
   ```
   any([False]) # From DefaultTrigger
   any([False]) # From Repeatedly(AfterCount(50))
   any([False, False]) # From both
   ```




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