This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit fbcf2bfeed1f3b1fd688b0094c92b0788aab11ed
Author: Francisco Fonseca <[email protected]>
AuthorDate: Thu May 16 21:25:41 2024 +0100

    Fix #35946: Visible DAG RUN doesn't point to the same dag run id (#38365)
    
    As stated by @nivdror, displaying a DAG RUN date different from
    the dag run id may cause confusion to users. I fixed this by
    changing the default displayed date to the Interval Start Date
    instead of Interval End Date.
    
    Co-authored-by: Tzu-ping Chung <[email protected]>
    (cherry picked from commit 4dce7459d9728933629f917d60500a74c3f29213)
---
 airflow/www/static/js/dag/details/Header.tsx | 4 ++--
 airflow/www/static/js/utils/index.test.ts    | 4 ++--
 airflow/www/static/js/utils/index.ts         | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/airflow/www/static/js/dag/details/Header.tsx 
b/airflow/www/static/js/dag/details/Header.tsx
index 78f30f3620..0e1ff59ec8 100644
--- a/airflow/www/static/js/dag/details/Header.tsx
+++ b/airflow/www/static/js/dag/details/Header.tsx
@@ -41,7 +41,7 @@ interface Props {
 
 const Header = ({ mapIndex }: Props) => {
   const {
-    data: { dagRuns, groups, ordering },
+    data: { dagRuns, groups },
   } = useGridData();
 
   const {
@@ -68,7 +68,7 @@ const Header = ({ mapIndex }: Props) => {
       runId.includes("scheduled__") ||
       runId.includes("backfill__") ||
       runId.includes("dataset_triggered__") ? (
-        <Time dateTime={getDagRunLabel({ dagRun, ordering })} />
+        <Time dateTime={getDagRunLabel({ dagRun })} />
       ) : (
         runId
       );
diff --git a/airflow/www/static/js/utils/index.test.ts 
b/airflow/www/static/js/utils/index.test.ts
index 4c8be82cfd..d5365a5a61 100644
--- a/airflow/www/static/js/utils/index.test.ts
+++ b/airflow/www/static/js/utils/index.test.ts
@@ -138,9 +138,9 @@ describe("Test getDagRunLabel", () => {
     note: "someRandomValue",
   } as DagRun;
 
-  test("Defaults to dataIntervalEnd", async () => {
+  test("Defaults to dataIntervalStart", async () => {
     const runLabel = getDagRunLabel({ dagRun });
-    expect(runLabel).toBe(dagRun.dataIntervalEnd);
+    expect(runLabel).toBe(dagRun.dataIntervalStart);
   });
 
   test("Passing an order overrides default", async () => {
diff --git a/airflow/www/static/js/utils/index.ts 
b/airflow/www/static/js/utils/index.ts
index 37dc5cb022..46ced684fe 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 = ["dataIntervalEnd", "executionDate"],
+  ordering = ["dataIntervalStart", "executionDate"],
 }: RunLabelProps) => dagRun[ordering[0]] ?? dagRun[ordering[1]];
 
 const getStatusBackgroundColor = (color: string, hasNote: boolean) =>

Reply via email to