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



##########
File path: sdks/python/apache_beam/transforms/trigger.py
##########
@@ -369,6 +370,53 @@ def has_ontime_pane(self):
     return False
 
 
+class AfterSynchronizedProcessingTime(TriggerFn):

Review comment:
       I'm rusty on what this entails. How to best expose it to `core.py` 
without putting in `__all__`?

##########
File path: sdks/python/apache_beam/transforms/trigger.py
##########
@@ -369,6 +370,53 @@ def has_ontime_pane(self):
     return False
 
 
+class AfterSynchronizedProcessingTime(TriggerFn):
+  """A "runner's-discretion" trigger downstream of a GroupByKey
+  with AfterProcessingTime trigger.
+
+  AfterSynchronizedProcessingTime is experimental.
+  No backwards compatibility guarantees.
+  """

Review comment:
       I mean, mostly triggers aren't Fns, so runners don't run this code at 
all. I've added a rather lengthy note explaining.

##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -2364,6 +2364,22 @@ def from_runner_api_parameter(
   def runner_api_requires_keyed_input(self):
     return True
 
+  def get_windowing(self, inputs):
+    # Circular dep, because trigger pulls in CombineFn
+    from apache_beam.transforms.trigger import AfterProcessingTime
+    from apache_beam.transforms.trigger import AfterSynchronizedProcessingTime
+    windowing = inputs[0].windowing
+    if not isinstance(windowing.triggerfn, AfterProcessingTime):

Review comment:
       Fair enough. My own practice is to put the short branch first to 
facilitate cognitively encompassing the whole if statement. I also prefer 
else-free statements when an `if` results in early return. This sort of fits 
both, but is also so short it hardly matters.
   
   Switched it.




----------------------------------------------------------------
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:
[email protected]


Reply via email to