The GitHub Actions job "Tests (AMD)" on airflow.git/backport-0120ba7-v3-2-test 
has succeeded.
Run started by GitHub user jason810496 (triggered by jason810496).

Head commit for run:
510dd46605aaf56c4600f2a51e981a31b2f26a2c / Deepak kumar <[email protected]>
[v3-2-test] API: Return 400 instead of 500 from materialize_asset for invalid 
validation input (#67445)

The materialize_asset POST endpoint passed user input (dag_run_id,
logical_date/data_interval pairing, partition_key) straight through to
MaterializeAssetBody.validate_context() and dag.create_dagrun(), which raise
ValueError / ParamValidationError on invalid input (e.g. dag_run_id containing
'..', invalid partition_key type, logical_date/data_interval mismatch). Those
exceptions escaped uncaught and were returned as 500 Internal Server Error,
even though the route's OpenAPI spec already documents 400 for this case.

Wrap the validate_context / create_dagrun calls in try/except and re-raise as
HTTPException(400) with the validator's message in the detail, matching the
sibling pattern in dag_run.trigger_dag_run.

Regression test asserts dag_run_id='bad..id' returns 400, not 500.
(cherry picked from commit 0120ba7fd5be8b6d5e7e4184209fb0479127f2d8)

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

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

With regards,
GitHub Actions via GitBox


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

Reply via email to