You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "avandierast (via GitHub)" <gi...@apache.org> on 2024/01/26 16:21:27 UTC

[I] API Bug: patch a task instance state to skipped crashes. [airflow]

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

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.7.2
   
   ### What happened?
   
   Hi :)
   
   When calling TaskInstanceApi.patch_task_instance with new_status=skipped, the API crashes (500) with the following error message:
   `ValueError: skipped is not a valid DagRunState`.
   
   ### What you think should happen instead?
   
   Since we are patching a task instance, we shouldn't be refused because the chosen status is not possible for a dag run.
   
   ### How to reproduce
   
   Create a simple dag like:
   ```python
   with DAG(
       dag_id="sleeping_dag",
       catchup=False,
       start_date=pendulum.datetime(2023, 1, 1, tz="UTC"),
       schedule=None,
   ) as sleeping_dag:
       sleeping_task = BashOperator(
           task_id="sleeping_task",
           bash_command=("sleep 60"),
       )
   ```
   
   And then a curl to patch to skipped (I used the swagger UI):
   ```bash
   curl -X 'PATCH' \
     'http://localhost:8080/api/v1/dags/sleeping_dag/dagRuns/manual__2024-01-26T16%3A16%3A06.275444%2B00%3A00/taskInstances/sleeping_task' \
     -H 'accept: application/json' \
     -H 'Content-Type: application/json' \
     -d '{
     "dry_run": false,
     "new_state": "skipped"
   }'
   ```
   
   ### Operating System
   
   Red Hat Enterprise Linux 8.6
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   This problem happens every time.
   
   It seems that the problem comes from the following line of code:
   https://github.com/apache/airflow/blob/bc0e0d95d471868cd4878064fb547aa431506eb8/airflow/api/common/mark_tasks.py#L147
   A DagRunState is built with a state that is supposed to be a task instance state. But the task instance state is equal to SKIPPED and thus it throws an exception.
   
   The skipped status was not possible originaly but was added by this PR: https://github.com/apache/airflow/pull/31421
   
   I hope we can make this endpoint work with the status skipped. I was glad to see this possibility in the openapi documentation :)
   
   ### Are you willing to submit PR?
   
   - [ ] 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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patching a task instance state to skipped crashes. [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #37034:
URL: https://github.com/apache/airflow/issues/37034#issuecomment-1913485932

   > Hi, Can I work on this?
   
   Assigned 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patching a task instance state to skipped crashes. [airflow]

Posted by "killua1zoldyck (via GitHub)" <gi...@apache.org>.
killua1zoldyck commented on issue #37034:
URL: https://github.com/apache/airflow/issues/37034#issuecomment-1913363927

   Hi, Can I work on this?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patching a task instance state to skipped crashes. [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #37034: API Bug: patching a task instance state to skipped crashes.
URL: https://github.com/apache/airflow/issues/37034


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patch a task instance state to skipped crashes. [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #37034:
URL: https://github.com/apache/airflow/issues/37034#issuecomment-1912329955

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patching a task instance state to skipped crashes. [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #37034:
URL: https://github.com/apache/airflow/issues/37034#issuecomment-3077191835

   This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patching a task instance state to skipped crashes. [airflow]

Posted by "ehellmann-nydig (via GitHub)" <gi...@apache.org>.
ehellmann-nydig commented on issue #37034:
URL: https://github.com/apache/airflow/issues/37034#issuecomment-2228686374

   Any updates on this? I'm attempting to mark a taskgroup as skipped if all tasks are skipped. The group is effectively skipped since the first operator is short_circuit operator, but unfortunately that operator get's marked as success so the whole group is marked as success. My idea is to attempt to mark the chort_circuit instance as skipped if the result of it is skip, so that the group can be marked as skipped. This is a blocker for me.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] API Bug: patching a task instance state to skipped crashes. [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #37034:
URL: https://github.com/apache/airflow/issues/37034#issuecomment-3393002078

   This issue has been closed because it has not received response from the issue author.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org