henry3260 opened a new pull request, #70138:
URL: https://github.com/apache/airflow/pull/70138
## Why
The `2026-06-30` execution API version added two new fields to the `DagRun`
model: `team_name` (`AddTeamNameField`) and `partition_date`
(`AddPartitionDateField`). Both version changes only registered response
converters for the **nested** `dag_run` payload (e.g. inside `TIRunContext`),
but not for endpoints that return a `DagRun` **directly** — `GET
/dag-runs/{dag_id}/{run_id}` and `GET /dag-runs/previous`.
As a result, when an older Task SDK client pins a pre-`2026-06-30` API
version, those endpoints still return the new fields. The Task SDK's generated
`DagRun` model uses `extra="forbid"`, so the unexpected fields cause a Pydantic
validation error and break these calls for older clients — exactly what the
versioning layer is supposed to prevent.
## What
-
`airflow-core/src/airflow/api_fastapi/execution_api/versions/v2026_06_30.py`:
add `@convert_response_to_previous_version_for(DagRun)` converters to both
`AddTeamNameField` and `AddPartitionDateField` so the new fields are stripped
from direct `DagRun` responses. Because schema-based converters match the
route's response model by identity, the `/dag-runs/previous` route (annotated
`DagRun | None`) never matches `DagRun`, so it additionally gets path-based
converters for `GET /dag-runs/previous`.
-
`airflow-core/tests/unit/api_fastapi/execution_api/versions/v2026_06_30/test_dag_runs.py`
(new): tests that requests with the previous API version (`2026-04-06`) get
responses without `team_name`/`partition_date` from both endpoints, and that
the `null` previous-run response still works.
--
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]