This is an automated email from the ASF dual-hosted git repository.
jason810496 pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-4-test by this push:
new 440668df568 [v3-4-test] TS-SDK: inherit the Dag queue when a task
passes queue undefined (#76123) (#76159)
440668df568 is described below
commit 440668df568971f2a628cae02eb43743d63f5f16
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Oct 31 17:50:55 2026 +0000
[v3-4-test] TS-SDK: inherit the Dag queue when a task passes queue
undefined (#76123) (#76159)
withDagQueue treated a present queue key as a named queue, but an undefined
value serializes to nothing, so the task ran on the default queue. Treat
undefined as unset, as the SDK does for other optional fields.
(cherry picked from commit 4616b88380cd0bec638a910314c0423d35c10c90)
Co-authored-by: Anurag-S1ngh <[email protected]>
---
ts-sdk/src/coordinator/serde.ts | 2 +-
ts-sdk/tests/coordinator/serde.test.ts | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ts-sdk/src/coordinator/serde.ts b/ts-sdk/src/coordinator/serde.ts
index b6938fa81d6..982b21bc0e3 100644
--- a/ts-sdk/src/coordinator/serde.ts
+++ b/ts-sdk/src/coordinator/serde.ts
@@ -230,7 +230,7 @@ export function serializeDag(
* field is.
*/
function withDagQueue(spec: object, dagQueue: string | undefined): object {
- if (dagQueue === undefined || "queue" in spec) return spec;
+ if (dagQueue === undefined || ("queue" in spec && spec.queue !== undefined))
return spec;
return { ...spec, queue: dagQueue };
}
diff --git a/ts-sdk/tests/coordinator/serde.test.ts
b/ts-sdk/tests/coordinator/serde.test.ts
index df508ec2871..f47c52625bf 100644
--- a/ts-sdk/tests/coordinator/serde.test.ts
+++ b/ts-sdk/tests/coordinator/serde.test.ts
@@ -182,6 +182,14 @@ describe("serializeDag", () => {
expect(tasks.get("heavy")?.["queue"]).toBe("typescript_large");
});
+ it("inherits the Dag's queue when a task passes an undefined queue", () =>
{
+ const dag = new Dag("d", { queue: "typescript" });
+ place(dag, "one", [], { queue: undefined });
+
+ const tasks = taskMap(serializeDag(dag, "", ".") as Json);
+ expect(tasks.get("one")?.["queue"]).toBe("typescript");
+ });
+
it("writes no queue when neither the Dag nor the task names one", () => {
expect(taskVar(serializeWith({}))).not.toHaveProperty("queue");
});