Skip to content

Commit

Permalink
Always use logical date in DAG run header (#43148)
Browse files Browse the repository at this point in the history
Co-authored-by: Kaxil Naik <[email protected]>
  • Loading branch information
uranusjr and kaxil authored Oct 18, 2024
1 parent 3f52c83 commit fb49aa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions airflow/www/static/js/utils/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down
2 changes: 1 addition & 1 deletion airflow/www/static/js/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down

0 comments on commit fb49aa3

Please sign in to comment.