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


##########
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:
   Thanks for the review, addressed in the latest commit.



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