You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/03/02 01:41:43 UTC

[GitHub] [beam] robertwb commented on a change in pull request #14060: [BEAM-11868] Make Python GroupByKey convert AfterProcessingTime to AfterSynchronizedProcessingTime

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



##########
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:
       Maybe make a note that this current implementation simply always fires. 

##########
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:
       Nit: I find "if [special case] else ..." easier to read than "if not [special case] else ..."

##########
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):

Review comment:
       It's been a while since I've touched this code, but I think so. Can't be hard to verify. 

##########
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:
       Do we want users to use this directly, or should we make it private? 




----------------------------------------------------------------
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:
users@infra.apache.org