From 3f77a0a6d973183756706dd5ef7798b82e5f0074 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Sat, 19 Oct 2024 03:26:00 +0800 Subject: [PATCH] Always use logical date in DAG run header (#43148) (#43163) --- airflow/www/static/js/utils/index.test.ts | 8 ++++---- airflow/www/static/js/utils/index.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/airflow/www/static/js/utils/index.test.ts b/airflow/www/static/js/utils/index.test.ts index a12f66b36c5f..569d3af98b53 100644 --- a/airflow/www/static/js/utils/index.test.ts +++ b/airflow/www/static/js/utils/index.test.ts @@ -146,14 +146,14 @@ describe("Test getDagRunLabel", () => { note: "someRandomValue", } as DagRun; - test("Defaults to dataIntervalStart", async () => { + test("Defaults to executionDate", async () => { const runLabel = getDagRunLabel({ dagRun }); - expect(runLabel).toBe(dagRun.dataIntervalStart); + expect(runLabel).toBe(dagRun.executionDate); }); test("Passing an order overrides default", async () => { - const runLabel = getDagRunLabel({ dagRun, ordering: ["executionDate"] }); - expect(runLabel).toBe(dagRun.executionDate); + const runLabel = getDagRunLabel({ dagRun, ordering: ["dataIntervalEnd"] }); + expect(runLabel).toBe(dagRun.dataIntervalEnd); }); }); diff --git a/airflow/www/static/js/utils/index.ts b/airflow/www/static/js/utils/index.ts index 747ca474c73a..87428ce8363d 100644 --- a/airflow/www/static/js/utils/index.ts +++ b/airflow/www/static/js/utils/index.ts @@ -169,7 +169,7 @@ interface RunLabelProps { const getDagRunLabel = ({ dagRun, - ordering = ["dataIntervalStart", "executionDate"], + ordering = ["executionDate"], }: RunLabelProps) => dagRun[ordering[0]] ?? dagRun[ordering[1]]; const getStatusBackgroundColor = (color: string, hasNote: boolean) =>