From 8fdcf769513874493c47bc07bd8042a387e0a8d9 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Fri, 18 Oct 2024 15:22:53 +0800 Subject: [PATCH] Always use logical date in DAG run header --- 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) =>