beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [1/2] beam git commit: DataflowRunner: disable PAssert use of metrics when FnAPI is enabled
Date Tue, 04 Apr 2017 00:11:02 GMT
Repository: beam
Updated Branches:
  refs/heads/master 844e53e34 -> 697063297


DataflowRunner: disable PAssert use of metrics when FnAPI is enabled

FnApi does not yet support metrics


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/ef75c074
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/ef75c074
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/ef75c074

Branch: refs/heads/master
Commit: ef75c074fc757e3207cd1ec2dd9e67736d7aaed7
Parents: 844e53e
Author: Dan Halperin <dhalperi@google.com>
Authored: Mon Apr 3 12:46:33 2017 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Mon Apr 3 17:10:48 2017 -0700

----------------------------------------------------------------------
 .../beam/runners/dataflow/testing/TestDataflowRunner.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/ef75c074/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowRunner.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowRunner.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowRunner.java
index 5315671..d220bb0 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowRunner.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowRunner.java
@@ -37,6 +37,7 @@ import javax.annotation.Nullable;
 import org.apache.beam.runners.dataflow.DataflowClient;
 import org.apache.beam.runners.dataflow.DataflowPipelineJob;
 import org.apache.beam.runners.dataflow.DataflowRunner;
+import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions;
 import org.apache.beam.runners.dataflow.util.MonitoringUtil;
 import org.apache.beam.runners.dataflow.util.MonitoringUtil.JobMessagesHandler;
 import org.apache.beam.sdk.Pipeline;
@@ -183,7 +184,13 @@ public class TestDataflowRunner extends PipelineRunner<DataflowPipelineJob>
{
 
   @VisibleForTesting
   void updatePAssertCount(Pipeline pipeline) {
-    expectedNumberOfAssertions = PAssert.countAsserts(pipeline);
+    DataflowPipelineOptions options = pipeline.getOptions().as(DataflowPipelineOptions.class);
+    if (DataflowRunner.hasExperiment(options, "beam_fn_api")) {
+      // TODO[BEAM-1866]: FnAPI does not support metrics, so expect 0 assertions.
+      expectedNumberOfAssertions = 0;
+    } else {
+      expectedNumberOfAssertions = PAssert.countAsserts(pipeline);
+    }
   }
 
   /**


Mime
View raw message