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

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

                Author: ASF GitHub Bot
            Created on: 18/Apr/19 02:33
            Start Date: 18/Apr/19 02:33
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on pull request #8270: 
[BEAM-6894] Updates Dataflow runner to support external ParDos.
URL: https://github.com/apache/beam/pull/8270#discussion_r275563536
 
 

 ##########
 File path: sdks/python/apache_beam/transforms/core.py
 ##########
 @@ -1111,22 +1150,32 @@ def to_runner_api_parameter(self, context):
   @PTransform.register_urn(
       common_urns.primitives.PAR_DO.urn, beam_runner_api_pb2.ParDoPayload)
   def from_runner_api_parameter(pardo_payload, context):
-    assert pardo_payload.do_fn.spec.urn == python_urns.PICKLED_DOFN_INFO
-    fn, args, kwargs, si_tags_and_types, windowing = pickler.loads(
-        pardo_payload.do_fn.spec.payload)
-    if si_tags_and_types:
-      raise NotImplementedError('explicit side input data')
-    elif windowing:
-      raise NotImplementedError('explicit windowing')
-    result = ParDo(fn, *args, **kwargs)
-    # This is an ordered list stored as a dict (see the comments in
-    # to_runner_api_parameter above).
-    indexed_side_inputs = [
-        (int(re.match('side([0-9]+)(-.*)?$', tag).group(1)),
-         pvalue.AsSideInput.from_runner_api(si, context))
-        for tag, si in pardo_payload.side_inputs.items()]
-    result.side_inputs = [si for _, si in sorted(indexed_side_inputs)]
-    return result
+    # For external Java transforms we cannot build a Python ParDo object so
+    # we build a holder transform instead.
+    external_java_transform = False
+    if 'urn:beam:dofn:javasdk:' in pardo_payload.do_fn.spec.urn:
+      external_java_transform = True
+
+    if external_java_transform:
+      return RunnerAPIPTransformHolder(
+          pardo_payload, common_urns.primitives.PAR_DO.urn)
+    else:
+      assert pardo_payload.do_fn.spec.urn == python_urns.PICKLED_DOFN_INFO
 
 Review comment:
   Done.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 229542)
    Time Spent: 4h 10m  (was: 4h)

> ExternalTransform.expand() does not create the proper AppliedPTransform 
> sub-graph
> ---------------------------------------------------------------------------------
>
>                 Key: BEAM-6894
>                 URL: https://issues.apache.org/jira/browse/BEAM-6894
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Chamikara Jayalath
>            Assignee: Chamikara Jayalath
>            Priority: Major
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> 'ExternalTransform.expand()' can be used to expand a remote transform and 
> build the correct runner-api subgraph for that transform. However currently 
> we do not modify the AppliedPTransform sub-graph correctly during this 
> process. Relevant code location here.
> [https://github.com/apache/beam/blob/master/sdks/python/apache_beam/transforms/external.py#L135]
>  
> Without this, DataflowRunner that relies in this object graph (not just the 
> runner API proto) to build the job submission request to Dataflow service 
> cannot construct this request properly.
>  
> cc: [~robertwb]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to