Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class DAGDetailsResponse(DAGResponse):
template_search_path: Iterable[str] | None
timezone: str | None
last_parsed: datetime | None
owner_links: dict[str, str] | None = None

@field_validator("timezone", mode="before")
@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7887,6 +7887,13 @@ components:
format: date-time
- type: 'null'
title: Last Parsed
owner_links:
anyOf:
- additionalProperties:
type: string
type: object
- type: 'null'
title: Owner Links
file_token:
type: string
title: File Token
Expand Down
14 changes: 14 additions & 0 deletions airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,20 @@ export const $DAGDetailsResponse = {
],
title: "Last Parsed",
},
owner_links: {
anyOf: [
{
additionalProperties: {
type: "string",
},
type: "object",
},
{
type: "null",
},
],
title: "Owner Links",
},
file_token: {
type: "string",
title: "File Token",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ export type DAGDetailsResponse = {
template_search_path: Array<string> | null;
timezone: string | null;
last_parsed: string | null;
owner_links?: {
[key: string]: string;
} | null;
/**
* Return file token.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,22 @@ class TestDagDetails(TestDagEndpoint):
"""Unit tests for DAG Details."""

@pytest.mark.parametrize(
"query_params, dag_id, expected_status_code, dag_display_name, start_date",
"query_params, dag_id, expected_status_code, dag_display_name, start_date, owner_links",
[
({}, "fake_dag_id", 404, "fake_dag", "2023-12-31T00:00:00Z"),
({}, DAG2_ID, 200, DAG2_ID, "2021-06-15T00:00:00Z"),
({}, "fake_dag_id", 404, "fake_dag", "2023-12-31T00:00:00Z", {}),
({}, DAG2_ID, 200, DAG2_ID, "2021-06-15T00:00:00Z", {}),
],
)
@pytest.mark.usefixtures("configure_git_connection_for_dag_bundle")
def test_dag_details(
self, test_client, query_params, dag_id, expected_status_code, dag_display_name, start_date
self,
test_client,
query_params,
dag_id,
expected_status_code,
dag_display_name,
start_date,
owner_links,
):
response = test_client.get(f"/dags/{dag_id}/details", params=query_params)
assert response.status_code == expected_status_code
Expand Down Expand Up @@ -445,6 +452,7 @@ def test_dag_details(
"next_dagrun_logical_date": None,
"next_dagrun_run_after": None,
"owners": ["airflow"],
"owner_links": {},
"params": {
"foo": {
"__class": "airflow.sdk.definitions.param.Param",
Expand Down
1 change: 1 addition & 0 deletions airflow-ctl/src/airflowctl/api/datamodels/generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,7 @@ class DAGDetailsResponse(BaseModel):
template_search_path: Annotated[list[str] | None, Field(title="Template Search Path")] = None
timezone: Annotated[str | None, Field(title="Timezone")] = None
last_parsed: Annotated[datetime | None, Field(title="Last Parsed")] = None
owner_links: Annotated[dict[str, str] | None, Field(title="Owner Links")] = None
file_token: Annotated[str, Field(description="Return file token.", title="File Token")]
concurrency: Annotated[
int, Field(description="Return max_active_tasks as concurrency.", title="Concurrency")
Expand Down