jason810496 opened a new pull request, #74041: URL: https://github.com/apache/airflow/pull/74041
STACKLINE related: #71929 Part of the native Dag e2e stack, split out of #74035. Builds on P1 ([layer diff](https://github.com/apache/airflow/compare/jason/lang-sdk-e2e/03a-dag-processor-base...jason/lang-sdk-e2e/03b-serialized-dag-validation)). ## Why A Lang-SDK runtime returns its Dags already serialized, so Airflow has to check them and fill what the runtime cannot know before storing them (P4). ## What changes - `DagSerialization.validate_serialized_dag(data)` checks a serialized Dag against the JSON schema, loads it, and rejects a cycle in its task graph with `detect_cycle` from #74034. It raises `DeserializationError`. - `DagSerialization.fill_config_defaults(data)` fills an unset `max_active_tasks`, `max_active_runs`, `max_consecutive_failed_dag_runs`, `catchup` and `disable_bundle_versioning` from `[core] max_active_tasks_per_dag`, `[core] max_active_runs_per_dag`, `[core] max_consecutive_failed_dag_runs_per_dag`, `[scheduler] catchup_by_default` and `[dag_processor] disable_bundle_versioning`, as a Python Dag does. A value the Dag sets is kept. - The field table of `airflow-core/adr/lang-sdk/0004-dag-parsing.md` says Airflow fills an unset field from its config. ```python DagSerialization.fill_config_defaults(data) DagSerialization.validate_serialized_dag(data) # raises DeserializationError ``` ## How to test ```bash uv run --project airflow-core pytest airflow-core/tests/unit/serialization/test_dag_serialization.py -k "ValidateSerializedDag or FillConfigDefaults" -xvs ``` --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes, with help of Claude Code Opus 5.5 following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
