diff --git a/airflow/api/common/mark_tasks.py b/airflow/api/common/mark_tasks.py index a9d8325e5ba64..0ff6d495d1ba3 100644 --- a/airflow/api/common/mark_tasks.py +++ b/airflow/api/common/mark_tasks.py @@ -144,8 +144,12 @@ def set_state( confirmed_infos = list(_iter_existing_dag_run_infos(dag, dag_run_ids, session=session)) confirmed_dates = [info.logical_date for info in confirmed_infos] - sub_dag_run_ids = list( - _iter_subdag_run_ids(dag, session, DagRunState(state), task_ids, commit, confirmed_infos), + sub_dag_run_ids = ( + list( + _iter_subdag_run_ids(dag, session, DagRunState(state), task_ids, commit, confirmed_infos), + ) + if not state == TaskInstanceState.SKIPPED + else [] ) # now look for the task instances that are affected