uranusjr commented on code in PR #75444:
URL: https://github.com/apache/airflow/pull/75444#discussion_r4357777770


##########
java-sdk/scala_spark_example/src/main/scala/org/apache/airflow/example/ScalaSparkExample.scala:
##########
@@ -60,13 +60,17 @@ private object SparkEtl {
       .config("spark.driver.bindAddress", "127.0.0.1")
       .getOrCreate()
 
-  // 3-arg getXCom(key, dagId, taskId) reads the upstream return value; wire
-  // integers arrive boxed.
+  // "return_value" is the key Airflow gives a task's return value, and the key
+  // both calls default to in Java. Scala does not take Kotlin's default
+  // arguments, so it passes the key: 3-arg getXCom is (key, dagId, taskId).
+  // Wire integers arrive boxed.

Review Comment:
   This comment is wrong: `getXCom`/`setXCom` are `@JvmOverloads`, so Scala can 
call `client.getXCom(taskId)` and `client.setXCom(value)` directly. Drop 
`ReturnValueKey` and the comment, and use those overloads.



##########
java-sdk/scala_spark_example/src/main/scala/org/apache/airflow/example/ScalaSparkExample.scala:
##########
@@ -60,13 +60,17 @@ private object SparkEtl {
       .config("spark.driver.bindAddress", "127.0.0.1")
       .getOrCreate()
 
-  // 3-arg getXCom(key, dagId, taskId) reads the upstream return value; wire
-  // integers arrive boxed.
+  // "return_value" is the key Airflow gives a task's return value, and the key
+  // both calls default to in Java. Scala does not take Kotlin's default
+  // arguments, so it passes the key: 3-arg getXCom is (key, dagId, taskId).
+  // Wire integers arrive boxed.

Review Comment:
   `getXCom`/`setXCom` are `@JvmOverloads`, so Scala can call 
`client.getXCom(taskId)` and `client.setXCom(value)` directly. Drop 
`ReturnValueKey` and the comment, and use those overloads.



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