JoranDox opened a new issue, #31420:
URL: https://github.com/apache/airflow/issues/31420

   ### Apache Airflow version
   
   main (development)
   
   ### What happened
   
   see also: https://github.com/apache/airflow/issues/25463
   
   From the conversation there, it sounds like it's intended to be possible to 
set a task to "skipped" via REST API, but it's not.
   Instead the next best thing we have is marking as success & adding a note.
   
   ### What you think should happen instead
   
   I see no reason for users to not just be able to set tasks to "skipped". I 
could imagine reasons to avoid "queued", and some other more "internal" states, 
but skipped makes perfect sense to me for 
   - tasks that failed and got fixed externally
   - tasks that failed but are now irrelevant because of a newer run
   in case you still want to be able to see those in the future (actually, a 
custom state would be even better)
   
   ### How to reproduce
   
   ```python
   # task is just a dictionary with the right values for below
   r = requests.patch(
       
f"{base_url}/api/v1/dags/{task['dag_id']}/dagRuns/{task['dag_run_id']}/taskInstances/{task['task_id']}",
       json={
           "new_state": "skipped",
       },
       headers={"Authorization": token},
   )
   ```
   -> r.json() gives
   `{'detail': "'skipped' is not one of ['success', 'failed'] - 'new_state'", 
'status': 400, 'title': 'Bad Request', 'type': 
'http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/BadRequest'}`
   
   ### Operating System
   
   /
   
   ### Versions of Apache Airflow Providers
   
   /
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   /
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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