tquazi commented on code in PR #30478:
URL: https://github.com/apache/airflow/pull/30478#discussion_r1167617828
##########
airflow/models/dag.py:
##########
@@ -1915,9 +1914,118 @@ def set_task_instance_state(
only_failed=True,
session=session,
# Exclude the task itself from being cleared
- exclude_task_ids={task_id},
+ exclude_task_ids=frozenset({task_id}),
+ )
+
+ return altered
+
+ @provide_session
+ def set_task_group_state(
+ self,
+ *,
+ group_id: str,
+ execution_date: datetime | None = None,
+ run_id: str | None = None,
+ state: TaskInstanceState,
+ upstream: bool = False,
+ downstream: bool = False,
+ future: bool = False,
+ past: bool = False,
+ commit: bool = True,
+ session: Session = NEW_SESSION,
+ ) -> list[TaskInstance]:
+ """
+ Set the state of the TaskGroup to the given state, and clear its
downstream tasks that are
+ in failed or upstream_failed state.
Review Comment:
When we set the state of a Task to Success/Failure, the existing logic is to
clear downstream tasks that are in failed or up_stream failed state. I am
assuming this to be valid for TaskGroup as well. Am I missing something here.
Thanks!
--
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]