pierrejeambrun commented on issue #69360:
URL: https://github.com/apache/airflow/issues/69360#issuecomment-5281059855

     Looked into this and I don't think we should take a fix here. The `TODO` 
predates the shape that ended up becoming the execution API's error convention, 
and every other error response in the module today
     uses the same non-RFC-9457 shape:
   
     - `{"reason": "not_found" | "invalid_state" | "already_exists" | ...,  
"message": "..."}` (with optional extras like `previous_state`) — used across 
`dag_runs.py`, `xcoms.py`, `connections.py`,
     `variables.py`, `dags.py`, `assets.py`, `asset_events.py`, 
`asset_state_store.py`, `hitl.py`, `connection_tests.py`, 
`task_state_store.py`, and `task_instances.py`.
     - Plain string `detail` in `security.py` (FastAPI default).
   
     Zero endpoints emit `type` / `title` / `status` / `instance`. The endpoint 
this issue points at is *consistent* with the rest — the `TODO` is stale.
   
     The shape is also load-bearing: the task SDK parses it in 
`task-sdk/src/airflow/sdk/api/client.py:255` — `TaskAlreadyRunningError` is 
raised on `detail["reason"] == "invalid_state"` and
     `detail["previous_state"] == "running"`. Changing one endpoint to RFC 9457 
would break that path *and* make that endpoint the only RFC-9457 endpoint in 
the execution API — a worse inconsistency than what
     exists today.
   
     Moving the execution API to RFC 9457 would need to be a coordinated 
cross-cutting change (all endpoints + task-sdk client parsers + docs) and 
probably warrants its own AIP-style conversation, not a
     single-endpoint fix.
   
     Closing this as won't-fix. I'll open a small PR that just deletes the 
stale `TODO` comment so it stops attracting drive-by RFC-9457 PRs.
   
   


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