Closed abhishekbhakat closed 3 days ago
Thanks. Indeed seems that we are creating DagRunState
there rather than TaskInstanceState
as an enum and DagRunState
does not have skipped
state option. Marked it as a good first issue - and feel free to take a stab on it if you want.
For now, I have raised a PR to give empty list for subdags if the state is TaskInstanceState.SKIPPED
.
And verified that APIs are now working for usual scenarios. Not sure about subdags.
Apache Airflow version
main (development)
If "Other Airflow 2 version" selected, which one?
No response
What happened?
We have 2 API endpoints to update TaskInstance State:
Both these endpoint calls
set_state()
function in: https://github.com/apache/airflow/blob/a8c4830d9728e9e25d1164e124004eb42cda6e58/airflow/api/common/mark_tasks.py#L85This has an older code for
_iter_subdag_run_ids
: https://github.com/apache/airflow/blob/a8c4830d9728e9e25d1164e124004eb42cda6e58/airflow/api/common/mark_tasks.py#L148-L150This is passing a state that we give to
DagRunState(state)
. Whereasskipped
is not a valid state for DagRun.Error log for 1st endpoint:
Error log for 2nd endpoint:
What you think should happen instead?
Shouldn't break and update the task state to skipped as we publish skipped can be a valid input for these APIs in the API reference.
How to reproduce
Call these APIs for a historical DagRun.
Operating System
Debian GNU/Linux 11 (bullseye)
Versions of Apache Airflow Providers
NA
Deployment
Official Apache Airflow Helm Chart
Deployment details
NA
Anything else?
NA
Are you willing to submit PR?
Code of Conduct