diff --git a/airflow/api_fastapi/openapi/v1-generated.yaml b/airflow/api_fastapi/openapi/v1-generated.yaml index b4bbf0598b7bd1..48e9544c10cd44 100644 --- a/airflow/api_fastapi/openapi/v1-generated.yaml +++ b/airflow/api_fastapi/openapi/v1-generated.yaml @@ -509,12 +509,12 @@ components: catchup: type: boolean title: Catchup - dagrun_timeout: + dag_run_timeout: anyOf: - type: string format: duration - type: 'null' - title: Dagrun Timeout + title: Dag Run Timeout dataset_expression: anyOf: - type: object @@ -547,31 +547,30 @@ components: title: Orientation params: anyOf: - - {} + - type: object - type: 'null' title: Params render_template_as_native_obj: type: boolean title: Render Template As Native Obj - template_searchpath: + template_search_path: anyOf: - - type: string - items: type: string type: array - type: 'null' - title: Template Searchpath + title: Template Search Path timezone: anyOf: - type: string - type: 'null' title: Timezone - last_loaded: + last_parsed: anyOf: - type: string format: date-time - type: 'null' - title: Last Loaded + title: Last Parsed file_token: type: string title: File Token @@ -582,14 +581,6 @@ components: title: Concurrency description: Return max_active_tasks as concurrency. readOnly: true - last_parsed: - anyOf: - - type: string - format: date-time - - type: 'null' - title: Last Parsed - description: Return last_loaded as last_parsed. - readOnly: true type: object required: - dag_id @@ -618,7 +609,7 @@ components: - next_dagrun_create_after - owners - catchup - - dagrun_timeout + - dag_run_timeout - dataset_expression - doc_md - start_date @@ -627,12 +618,11 @@ components: - orientation - params - render_template_as_native_obj - - template_searchpath + - template_search_path - timezone - - last_loaded + - last_parsed - file_token - concurrency - - last_parsed title: DAGDetailsResponse description: Specific serializer for DAG Details responses. DAGPatchBody: diff --git a/airflow/api_fastapi/serializers/dags.py b/airflow/api_fastapi/serializers/dags.py index 7275455022f151..964e526d31d266 100644 --- a/airflow/api_fastapi/serializers/dags.py +++ b/airflow/api_fastapi/serializers/dags.py @@ -116,17 +116,13 @@ class DAGDetailsResponse(DAGResponse): timezone: str | None last_parsed: datetime | None - def _validation_alias_fn(field_name: str): - val_dict = { - "dag_run_timeout": "dagrun_timeout", - "last_parsed": "last_loaded", - "template_search_path": "template_searchpath", - } - return val_dict.get(field_name, field_name) - model_config = ConfigDict( alias_generator=AliasGenerator( - validation_alias=_validation_alias_fn, + validation_alias=lambda field_name: { + "dag_run_timeout": "dagrun_timeout", + "last_parsed": "last_loaded", + "template_search_path": "template_searchpath", + }.get(field_name, field_name), ) ) diff --git a/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow/ui/openapi-gen/requests/schemas.gen.ts index 56f2412e879c26..e8aae616be06c0 100644 --- a/airflow/ui/openapi-gen/requests/schemas.gen.ts +++ b/airflow/ui/openapi-gen/requests/schemas.gen.ts @@ -239,7 +239,7 @@ export const $DAGDetailsResponse = { type: "boolean", title: "Catchup", }, - dagrun_timeout: { + dag_run_timeout: { anyOf: [ { type: "string", @@ -249,7 +249,7 @@ export const $DAGDetailsResponse = { type: "null", }, ], - title: "Dagrun Timeout", + title: "Dag Run Timeout", }, dataset_expression: { anyOf: [ @@ -314,7 +314,9 @@ export const $DAGDetailsResponse = { }, params: { anyOf: [ - {}, + { + type: "object", + }, { type: "null", }, @@ -325,11 +327,8 @@ export const $DAGDetailsResponse = { type: "boolean", title: "Render Template As Native Obj", }, - template_searchpath: { + template_search_path: { anyOf: [ - { - type: "string", - }, { items: { type: "string", @@ -340,7 +339,7 @@ export const $DAGDetailsResponse = { type: "null", }, ], - title: "Template Searchpath", + title: "Template Search Path", }, timezone: { anyOf: [ @@ -353,7 +352,7 @@ export const $DAGDetailsResponse = { ], title: "Timezone", }, - last_loaded: { + last_parsed: { anyOf: [ { type: "string", @@ -363,7 +362,7 @@ export const $DAGDetailsResponse = { type: "null", }, ], - title: "Last Loaded", + title: "Last Parsed", }, file_token: { type: "string", @@ -377,20 +376,6 @@ export const $DAGDetailsResponse = { description: "Return max_active_tasks as concurrency.", readOnly: true, }, - last_parsed: { - anyOf: [ - { - type: "string", - format: "date-time", - }, - { - type: "null", - }, - ], - title: "Last Parsed", - description: "Return last_loaded as last_parsed.", - readOnly: true, - }, }, type: "object", required: [ @@ -420,7 +405,7 @@ export const $DAGDetailsResponse = { "next_dagrun_create_after", "owners", "catchup", - "dagrun_timeout", + "dag_run_timeout", "dataset_expression", "doc_md", "start_date", @@ -429,12 +414,11 @@ export const $DAGDetailsResponse = { "orientation", "params", "render_template_as_native_obj", - "template_searchpath", + "template_search_path", "timezone", - "last_loaded", + "last_parsed", "file_token", "concurrency", - "last_parsed", ], title: "DAGDetailsResponse", description: "Specific serializer for DAG Details responses.", diff --git a/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow/ui/openapi-gen/requests/types.gen.ts index df779a4a3f8221..c0419302e9d61b 100644 --- a/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow/ui/openapi-gen/requests/types.gen.ts @@ -38,7 +38,7 @@ export type DAGDetailsResponse = { next_dagrun_create_after: string | null; owners: Array; catchup: boolean; - dagrun_timeout: string | null; + dag_run_timeout: string | null; dataset_expression: { [key: string]: unknown; } | null; @@ -47,11 +47,13 @@ export type DAGDetailsResponse = { end_date: string | null; is_paused_upon_creation: boolean | null; orientation: string; - params: unknown | null; + params: { + [key: string]: unknown; + } | null; render_template_as_native_obj: boolean; - template_searchpath: string | Array | null; + template_search_path: Array | null; timezone: string | null; - last_loaded: string | null; + last_parsed: string | null; /** * Return file token. */ @@ -60,10 +62,6 @@ export type DAGDetailsResponse = { * Return max_active_tasks as concurrency. */ readonly concurrency: number; - /** - * Return last_loaded as last_parsed. - */ - readonly last_parsed: string | null; }; /**