SamWheating commented on code in PR #34529: URL: https://github.com/apache/airflow/pull/34529#discussion_r1333530895
########## airflow/www/views.py: ########## @@ -5803,21 +5853,42 @@ def duration_f(self): @provide_session @action_logging def action_clear(self, task_instances, session: Session = NEW_SESSION): - """Clears the action.""" + """Clears an arbitrary number of task instances.""" try: - dag_to_tis = collections.defaultdict(list) - - for ti in task_instances: - dag = get_airflow_app().dag_bag.get_dag(ti.dag_id) - dag_to_tis[dag].append(ti) + count = self._clear_task_instances( + task_instances=task_instances, session=session, clear_downstream=False + ) + session.commit() + flash(f"{count} task instances have been cleared") Review Comment: Thoughts on something like: ```suggestion flash(f"{count} task instance{'s have' if count > 1 else ' has'} been cleared") ``` In order to read as `1 task instance has been cleared` / `4 task instances have been cleared`? -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org