[ 
https://issues.apache.org/jira/browse/BEAM-9562?focusedWorklogId=419189&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-419189
 ]

ASF GitHub Bot logged work on BEAM-9562:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Apr/20 07:21
            Start Date: 09/Apr/20 07:21
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on pull request #11314: [BEAM-9562] 
Send Timers over Data Channel as Elements
URL: https://github.com/apache/beam/pull/11314#discussion_r405985691
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/core.py
 ##########
 @@ -1323,12 +1325,47 @@ def _pardo_fn_data(self):
     windowing = None
     return self.fn, self.args, self.kwargs, si_tags_and_types, windowing
 
-  def to_runner_api_parameter(self, context):
+  def _get_key_and_window_coder(self, named_inputs):
+    if named_inputs is None or not self._signature.is_stateful_dofn():
+      return None, None
+    main_input = list(set(named_inputs.keys()) - set(self.side_inputs))[0]
+    input_pcoll = named_inputs[main_input]
+    kv_type_hint = input_pcoll.element_type
+    if kv_type_hint and kv_type_hint != typehints.Any:
+      coder = coders.registry.get_coder(kv_type_hint)
+      if not coder.is_kv_coder():
+        raise ValueError(
+            'Input elements to the transform %s with stateful DoFn must be '
+            'key-value pairs.' % self)
+      key_coder = coder.key_coder()
+    else:
+      key_coder = coders.registry.get_coder(typehints.Any)
+    window_coder = input_pcoll.windowing.windowfn.get_window_coder()
+    return key_coder, window_coder
+
+  def to_runner_api(self, context, **extra_kwargs):
+    # type: (PipelineContext, bool) -> beam_runner_api_pb2.FunctionSpec
+    has_parts = extra_kwargs.get('has_part', False)
 
 Review comment:
   You can leave this in the parameter list.
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 419189)
    Time Spent: 16h 50m  (was: 16h 40m)

> Remove timer from PCollection and treat timers as Elements 
> -----------------------------------------------------------
>
>                 Key: BEAM-9562
>                 URL: https://issues.apache.org/jira/browse/BEAM-9562
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-java-harness, sdk-py-harness
>            Reporter: Boyuan Zhang
>            Assignee: Boyuan Zhang
>            Priority: Major
>             Fix For: 2.21.0
>
>          Time Spent: 16h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to