beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [1/3] beam git commit: Improve error message for bad DoFn URN in ParDoTranslation
Date Tue, 12 Sep 2017 23:57:50 GMT
Repository: beam
Updated Branches:
  refs/heads/master 8e391d94f -> 3b04d1355


Improve error message for bad DoFn URN in ParDoTranslation


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

Branch: refs/heads/master
Commit: add2fa693f59fd7f0fef72e42fae993c80aba737
Parents: 001285a
Author: Kenneth Knowles <klk@google.com>
Authored: Tue Sep 12 11:38:46 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Tue Sep 12 11:38:46 2017 -0700

----------------------------------------------------------------------
 .../beam/runners/core/construction/ParDoTranslation.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/add2fa69/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java
----------------------------------------------------------------------
diff --git a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java
b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java
index 6ae95e4..2c94a8b 100644
--- a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java
+++ b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/ParDoTranslation.java
@@ -450,7 +450,13 @@ public class ParDoTranslation {
 
   private static DoFnAndMainOutput doFnAndMainOutputTagFromProto(SdkFunctionSpec fnSpec)
       throws InvalidProtocolBufferException {
-    checkArgument(fnSpec.getSpec().getUrn().equals(CUSTOM_JAVA_DO_FN_URN));
+    checkArgument(
+        fnSpec.getSpec().getUrn().equals(CUSTOM_JAVA_DO_FN_URN),
+        "Expected %s to be %s with URN %s, but URN was %s",
+        DoFn.class.getSimpleName(),
+        FunctionSpec.class.getSimpleName(),
+        CUSTOM_JAVA_DO_FN_URN,
+        fnSpec.getSpec().getUrn());
     byte[] serializedFn =
         fnSpec.getSpec().getPayload().toByteArray();
     return (DoFnAndMainOutput)


Mime
View raw message