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



##########
File path: 
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowMetrics.java
##########
@@ -280,22 +296,25 @@ private boolean isMetricTentative(MetricUpdate 
metricUpdate) {
      * @return a {@link MetricKey} that can be hashed and used to identify a 
metric.
      */
     private @Nullable MetricKey getMetricHashKey(MetricUpdate metricUpdate) {
-      String internalStepName = 
metricUpdate.getName().getContext().get("step");
-      String userStepName = getUserStepName(internalStepName);
-
-      if (userStepName == null
-          && (dataflowPipelineJob.transformStepNames == null
-              || 
!dataflowPipelineJob.transformStepNames.inverse().containsKey(internalStepName)))
 {
-        // If we can't translate internal step names to user step names, we 
just skip them
-        // altogether.
+      // If we can't translate internal step names to user step names, give up 
early
+      if (dataflowPipelineJob.transformStepNames == null) {

Review comment:
       Good catch. I duplicated this check in merge resolution.

##########
File path: 
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowMetrics.java
##########
@@ -280,22 +296,25 @@ private boolean isMetricTentative(MetricUpdate 
metricUpdate) {
      * @return a {@link MetricKey} that can be hashed and used to identify a 
metric.
      */
     private @Nullable MetricKey getMetricHashKey(MetricUpdate metricUpdate) {
-      String internalStepName = 
metricUpdate.getName().getContext().get("step");
-      String userStepName = getUserStepName(internalStepName);
-
-      if (userStepName == null
-          && (dataflowPipelineJob.transformStepNames == null
-              || 
!dataflowPipelineJob.transformStepNames.inverse().containsKey(internalStepName)))
 {
-        // If we can't translate internal step names to user step names, we 
just skip them
-        // altogether.
+      // If we can't translate internal step names to user step names, give up 
early
+      if (dataflowPipelineJob.transformStepNames == null) {

Review comment:
       Good catch. I duplicated this check in merge conflict resolution.




----------------------------------------------------------------
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