kaxil commented on code in PR #70138:
URL: https://github.com/apache/airflow/pull/70138#discussion_r3624798758


##########
airflow-core/src/airflow/api_fastapi/execution_api/versions/v2026_06_30.py:
##########
@@ -99,6 +99,20 @@ def remove_team_name_field(response: ResponseInfo) -> None:  
# type: ignore[misc
         if "dag_run" in response.body and isinstance(response.body["dag_run"], 
dict):
             response.body["dag_run"].pop("team_name", None)
 
+    @convert_response_to_previous_version_for(DagRun)  # type: ignore[arg-type]
+    def remove_team_name_from_dag_run(response: ResponseInfo) -> None:  # 
type: ignore[misc]
+        """Remove the ``team_name`` field from responses returning a DagRun 
directly."""
+        if isinstance(response.body, dict):
+            response.body.pop("team_name", None)
+
+    # Schema-based converters are matched against the route's response model 
by identity, so a
+    # route annotated ``DagRun | None`` never matches ``DagRun`` and has to be 
addressed by path.
+    @convert_response_to_previous_version_for("/dag-runs/previous", ["GET"])  
# type: ignore[arg-type]

Review Comment:
   There's a third endpoint that returns a `DagRun` directly: the compat `GET 
/dag-runs/{dag_id}/previous`, kept via `only_exists_in_older_versions` for 
clients pinning older than `2026-04-06`. It has no `response_model` annotation, 
so the `DagRun` schema converter won't match it, and the path converter here 
only covers `/dag-runs/previous`, so a worker pinning e.g. `2025-11-05` still 
gets `team_name`/`partition_date` from it and hits the same `extra="forbid"` 
failure. `note`/`partition_key` (added in `2026-04-06`) look like they already 
leak there for the same reason, so this may be pre-existing rather than 
something this PR must own. Is that compat path still reachable by old clients?



-- 
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]

Reply via email to