FrankYang0529 commented on code in PR #68983:
URL: https://github.com/apache/airflow/pull/68983#discussion_r3485535212


##########
java-sdk/example/src/java/org/apache/airflow/example/AnnotationExample.java:
##########
@@ -72,4 +72,18 @@ public void load(Context context, @Builder.XCom(task = 
"transform") long transfo
     }
     log.log(INFO, "Recovered on retry, try number {0}", context.ti.tryNumber);
   }
+
+  @Builder.Task(id = "produce_int")
+  public int produceInt() {
+    log.log(INFO, "Producing an int XCom");
+    return 7;
+  }
+
+  @Builder.Task(id = "consume_int")
+  public void consumeInt(@Builder.XCom(task = "produce_int") int value) {
+    log.log(INFO, "Got int XCom: {0}", value);
+    if (value != 7) {
+      throw new RuntimeException("expected 7 but got " + value);
+    }
+  }

Review Comment:
   Added a new dag `java_xcom_casting_example` and it also checks null case. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to