beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [2/3] beam git commit: Skip null options when converting back to argv
Date Tue, 02 May 2017 22:33:49 GMT
Skip null options when converting back to argv


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

Branch: refs/heads/master
Commit: 6d9b239350bb43a7bbe8b0c6ba1b20b806e2a03e
Parents: 4d6f6a1
Author: Kenneth Knowles <klk@google.com>
Authored: Mon May 1 10:25:37 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Tue May 2 14:01:15 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/beam/sdk/testing/TestPipeline.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/6d9b2393/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
index d45106c..ab8772b 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/TestPipeline.java
@@ -422,7 +422,9 @@ public class TestPipeline extends Pipeline implements TestRule {
       Iterator<Entry<String, JsonNode>> entries = optsNode.fields();
       while (entries.hasNext()) {
         Entry<String, JsonNode> entry = entries.next();
-        if (entry.getValue().isTextual()) {
+        if (entry.getValue().isNull()) {
+          continue;
+        } else if (entry.getValue().isTextual()) {
           optArrayList.add("--" + entry.getKey() + "=" + entry.getValue().asText());
         } else {
           optArrayList.add("--" + entry.getKey() + "=" + entry.getValue());


Mime
View raw message