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

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

                Author: ASF GitHub Bot
            Created on: 11/Nov/20 05:54
            Start Date: 11/Nov/20 05:54
    Worklog Time Spent: 10m 
      Work Description: chamikaramj commented on a change in pull request 
#13298:
URL: https://github.com/apache/beam/pull/13298#discussion_r521128353



##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py
##########
@@ -101,18 +101,13 @@ def _translate_step_name(self, internal_name):
           'Could not translate the internal step name %r since job graph is '
           'not available.' % internal_name)
     user_step_name = None
-    # pylint: disable=wrong-import-order, wrong-import-position
-    from apache_beam.runners.dataflow.internal import apiclient
-    if apiclient._use_unified_worker_portable_job(self._job_graph.options):
+    if (self._job_graph and internal_name
+        in self._job_graph.proto_pipeline.components.transforms.keys()):
       # Dataflow Runner v2 with portable job submission uses proto transform 
map
       # IDs for step names. Also PTransform.unique_name maps to user step 
names.
       # Hence we lookup user step names based on the proto.
-      proto_pipeline = self._job_graph.proto_pipeline
-      for transform_id in proto_pipeline.components.transforms.keys():
-        if internal_name == transform_id:
-          user_step_name = proto_pipeline.components.transforms[
-              transform_id].unique_name
-          break
+      user_step_name = self._job_graph.proto_pipeline.components.transforms[

Review comment:
       Yeah, we'll only enter this block if service chooses to use portable 
submission **and** use transform IDs as step names.




----------------------------------------------------------------
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: 510121)
    Time Spent: 3h 10m  (was: 3h)

> Update Dataflow metrics processor to handle portable jobs
> ---------------------------------------------------------
>
>                 Key: BEAM-11033
>                 URL: https://issues.apache.org/jira/browse/BEAM-11033
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Chamikara Madhusanka Jayalath
>            Assignee: Chamikara Madhusanka Jayalath
>            Priority: P1
>             Fix For: 2.26.0
>
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Currently, Dataflow metrics processor expects Dataflow internal step names 
> generated for v1beta3 job description in metrics returned by Dataflow 
> service: 
> [https://github.com/apache/beam/blob/master/sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py#L97]
>  
> But with portable job submission, Dataflow uses PTransform ID (in proto 
> pipeline) as the internal step name. Hence metrics processor should be 
> updated to handle this.



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

Reply via email to