pierrejeambrun commented on code in PR #62812:
URL: https://github.com/apache/airflow/pull/62812#discussion_r3111265596
##########
airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py:
##########
@@ -145,6 +214,53 @@ def _patch_task_instance_state(
except Exception:
log.exception("error calling listener")
+ return updated_tis
+
+
+def _patch_task_group_state(
+ group_id: str,
+ dag_run_id: str,
+ dag: SerializedDAG,
+ body: PatchTaskInstanceBody,
+ data: dict,
+ *,
+ session: Session,
+) -> list[TI]:
+ """Update the state of all task instances in a task group."""
+ updated_tis = dag.set_task_group_state(
+ group_id=group_id,
+ run_id=dag_run_id,
+ state=data["new_state"],
+ upstream=body.include_upstream,
+ downstream=body.include_downstream,
+ future=body.include_future,
+ past=body.include_past,
+ commit=True,
Review Comment:
Nit: `commit=True` is hardcoded here but the helper could easily take it as
a param. Not critical, but would make this reusable for a dry-run path later
without duplicating the function.
--
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]