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


##########
java-sdk/sdk/src/test/kotlin/org/apache/airflow/sdk/execution/SerdeTest.kt:
##########
@@ -186,6 +209,48 @@ internal class SerdeTest {
     )
   }
 
+  @Test
+  @DisplayName("Should give every task the Dag's queue unless the task sets 
its own")
+  fun shouldGiveEachTaskTheDagQueue() {
+    val dag = DagDef("d").config("queue", "java")
+    val extract = dag.task<Unit>("extract", SerdeNoopTask::class.java)
+    dag.task<Unit>("heavy", SerdeNoopTask::class.java).config("queue", 
"java_large")
+    dag.task<Unit>("on_default", SerdeNoopTask::class.java).config("queue", 
"default")
+    dag.If("has_rows", SerdeCondition::class.java).after(extract)
+    dag.Switch("pick", SerdeSwitch::class.java).after(extract)
+    dag.task("trigger", TriggerDagRun("reports"))
+    dag.task("trigger_on_python", TriggerDagRun("reports")).config("queue", 
"python")
+
+    val serialized = serializeDag(dag, "", ".")
+
+    assertEquals(
+      mapOf(
+        "extract" to "java",
+        "heavy" to "java_large",
+        // Set on the task, so it wins; at the schema default, so it is left 
out.

Review Comment:
   ```suggestion
   ```
   
   The test name and the null already say this. Remove.



##########
java-sdk/sdk/src/test/kotlin/org/apache/airflow/sdk/execution/SerdeTest.kt:
##########
@@ -186,6 +209,48 @@ internal class SerdeTest {
     )
   }
 
+  @Test
+  @DisplayName("Should give every task the Dag's queue unless the task sets 
its own")
+  fun shouldGiveEachTaskTheDagQueue() {
+    val dag = DagDef("d").config("queue", "java")
+    val extract = dag.task<Unit>("extract", SerdeNoopTask::class.java)
+    dag.task<Unit>("heavy", SerdeNoopTask::class.java).config("queue", 
"java_large")
+    dag.task<Unit>("on_default", SerdeNoopTask::class.java).config("queue", 
"default")
+    dag.If("has_rows", SerdeCondition::class.java).after(extract)
+    dag.Switch("pick", SerdeSwitch::class.java).after(extract)
+    dag.task("trigger", TriggerDagRun("reports"))
+    dag.task("trigger_on_python", TriggerDagRun("reports")).config("queue", 
"python")
+
+    val serialized = serializeDag(dag, "", ".")
+
+    assertEquals(
+      mapOf(
+        "extract" to "java",
+        "heavy" to "java_large",
+        // Set on the task, so it wins; at the schema default, so it is left 
out.

Review Comment:
   ```suggestion
   ```
   
   The test name and the null already say this.



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