Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use logical date in DAG run header #43148

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]];
romsharon98 marked this conversation as resolved.
Show resolved Hide resolved

const getStatusBackgroundColor = (color: string, hasNote: boolean) =>
Expand Down
Loading