This is an automated email from the ASF dual-hosted git repository.
jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 4dce7459d9 Fix #35946: Visible DAG RUN doesn't point to the same dag
run id (#38365)
4dce7459d9 is described below
commit 4dce7459d9728933629f917d60500a74c3f29213
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]>
---
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 a76ee62c86..5d9c05cbb8 100644
--- a/airflow/www/static/js/utils/index.test.ts
+++ b/airflow/www/static/js/utils/index.test.ts
@@ -143,9 +143,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 9eb8af9638..ff887b8569 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) =>