ephraimbuddy commented on code in PR #39440:
URL: https://github.com/apache/airflow/pull/39440#discussion_r1592377421
##########
airflow/www/views.py:
##########
@@ -2233,18 +2234,22 @@ def _clear_dag_tis(
session: Session,
):
if confirmed:
- count = dag.clear(
+ tis = dag.clear(
start_date=start_date,
end_date=end_date,
task_ids=task_ids,
include_subdags=recursive,
include_parentdag=recursive,
only_failed=only_failed,
session=session,
+ return_cleared_task_instances=True,
)
-
- msg = f"{count} task instances have been cleared"
- return redirect_or_json(origin, msg)
+ log = TaskContextLogger("webserver", call_site_logger=logger)
+ if isinstance(tis, list): # necessary for mypy
+ for ti in tis:
+ log.info("Task was manually cleared from the UI,
rerunning", ti=ti)
Review Comment:
There were issues in the first approach, I'm reworking it. I expect it to
work like every other task context logging
--
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]