Arunodoy18 opened a new pull request, #60011: URL: https://github.com/apache/airflow/pull/60011
Only allow deleting DAG runs in allowed states (queued, success, failed) What does this PR do? Only allows deletion of DAG runs in states: queued, success, or failed. Returns HTTP 400 if attempting to delete a DAG run in any other state (e.g., running). Clarifies the OpenAPI documentation for the delete DAG run endpoint, specifying which states are allowed for deletion. Adds tests to cover both allowed and disallowed states for deletion, ensuring correct response codes and behavior. Why is this needed? Previously, the API would return 204 even if a DAG run in a non-deletable state (like running) was not actually deleted, which could mislead users. This change makes the API response accurate and the behavior explicit. How to test Attempt to delete a DAG run in queued, success, or failed state: should return 204 and delete the run. Attempt to delete a DAG run in any other state (e.g., running): should return 400 with a clear error message. Closes:59497 -- 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]
