guan404ming commented on code in PR #75565:
URL: https://github.com/apache/airflow/pull/75565#discussion_r4509480797
##########
ts-sdk/tests/sdk/conditional.test.ts:
##########
@@ -219,6 +220,19 @@ describe("dag.if", () => {
expect(getDagOrderEdges(dag)).toContainEqual({ upstream: "has_rows",
downstream: "notify" });
});
+ it("declares a condition in a task group, under the group's prefix", async
() => {
+ const dag = new Dag("d");
+ const ifReady = dag.task("load_if_ready", async () => undefined)();
+ const fallback = dag.task("load_fallback", async () => undefined)();
+ const gate = dag.taskGroup("checks").if(async () => true, undefined, {
taskId: "has_rows" });
+ gate.then(ifReady).else(fallback);
+
+ expect(gate.taskId).toBe("checks.has_rows");
+
expect(getDagTaskGroups(dag).get("checks")?.taskIds).toEqual(["checks.has_rows"]);
+ const { skipDownstreamTasks } = await runHandler(dag, "checks.has_rows");
+ expect(skipDownstreamTasks).toHaveBeenCalledWith(["load_fallback"]);
+ });
Review Comment:
Added a test that awaits a group condition and checks the
`taskGroup("checks").if` label.
--
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]