The GitHub Actions job "Tests (ARM)" on airflow.git/v3-2-test has failed.
Run started by GitHub user jason810496 (triggered by jason810496).

Head commit for run:
6cde381f810f67b76b0e293910d7771e938cfc06 / github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
[v3-2-test] UI: Return 400 instead of 500 from structure_data on malformed 
asset_expression (#67489) (#67849)

* UI: Return clear 500 detail from structure_data when asset_expression is 
malformed

The /structure/structure_data endpoint calls get_upstream_assets() to walk the
serialized Dag's asset_expression. If the stored expression contains an unknown
key or asset type, get_upstream_assets() raises TypeError("Unsupported type: 
...").
The exception escaped uncaught and FastAPI returned a generic
{"detail": "Internal Server Error"} body with no context about which Dag
triggered it, forcing operators to dig through server logs to identify the
broken Dag.

Wrap the call in try/except TypeError and re-raise as HTTPException(500) with a
detail message identifying the Dag id and version. Still a 500 (the underlying
data corruption is genuinely server-side, not bad client input), but now with a
controlled, debuggable response body.

Regression test mocks get_upstream_assets to raise TypeError and asserts the
response is 500 with a detail message that includes the Dag id.

* Use 400 BAD_REQUEST for malformed asset_expression per review feedback

Per @jason810496 review feedback on #67489: the malformed asset_expression
ultimately originates from user-authored Dag code (via the Task SDK), so the
appropriate response is 400 BAD_REQUEST rather than 500 INTERNAL_SERVER_ERROR.

- Change status code from 500 to 400 in structure_data.
- Add HTTP_400_BAD_REQUEST to create_openapi_http_exception_doc so the OpenAPI
  spec advertises the new error response.
- Update regression test to assert 400 and rename accordingly.

Detail message is unchanged per reviewer: "It's fine to add more context".

* Revert uv.lock diff

---------
(cherry picked from commit eccbdb1b082be73b870e0a354d980ce2f542cc46)

Co-authored-by: Deepak kumar <[email protected]>
Co-authored-by: pierrejeambrun <[email protected]>

Report URL: https://github.com/apache/airflow/actions/runs/26807088630

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to