phanikumv commented on code in PR #74323:
URL: https://github.com/apache/airflow/pull/74323#discussion_r4192612118


##########
ts-sdk/tests/coordinator/serde.test.ts:
##########
@@ -726,6 +726,37 @@ describe("serializeDag", () => {
       expect(tasks.get("before")?.["downstream_task_ids"]).toEqual(["after"]);
     });
 
+    it("steps over an empty nested group to the tasks of the group holding 
it", () => {
+      // Python's find_leaves falls back to the parent group, so an edge out of
+      // an empty nested group leaves from whatever the parent finishes with.
+      const dag = new Dag("d");
+      const outer = dag.taskGroup("outer");
+      place(outer, "t");
+      const inner = outer.taskGroup("inner");
+      const load = place(dag, "load");
+      inner.before(load);
+
+      const tasks = taskMap(serializeDag(dag, "", ".") as Json);
+      expect(tasks.get("outer.t")?.["downstream_task_ids"]).toEqual(["load"]);
+    });
+
+    it("resolves a group's endpoints against the edges drawn before it", () => 
{
+      // outer's only root once inner runs before t, so the edge into outer
+      // reaches nothing else.
+      const dag = new Dag("d");
+      const extract = place(dag, "extract");
+      const outer = dag.taskGroup("outer");
+      const t = place(outer, "t");
+      const inner = outer.taskGroup("inner");
+      place(inner, "i");
+      inner.before(t);
+      extract.before(outer);
+
+      const tasks = taskMap(serializeDag(dag, "", ".") as Json);
+      
expect(tasks.get("extract")?.["downstream_task_ids"]).toEqual(["outer.inner.i"]);

Review Comment:
   The second test, "resolves a group's endpoints against the edges drawn 
before it", doesn't exercise this new branch. It has no empty group, so the 
fallback is never reached and it passes without the fix



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