Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ def set_dag_runs_state(
@provide_session
def clear(
self,
task_ids: Collection[str] | Collection[tuple[str, int]] | None = None,
task_ids: Collection[str | tuple[str, int]] | None = None,
start_date: datetime | None = None,
end_date: datetime | None = None,
only_failed: bool = False,
Expand Down
19 changes: 11 additions & 8 deletions airflow/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from functools import wraps
from json import JSONDecodeError
from operator import itemgetter
from typing import Any, Callable
from typing import Any, Callable, Collection
from urllib.parse import unquote, urljoin, urlsplit

import configupdater
Expand Down Expand Up @@ -2013,11 +2013,12 @@ def _clear_dag_tis(
dag: DAG,
start_date: datetime | None,
end_date: datetime | None,
origin: str,
task_ids=None,
recursive=False,
confirmed=False,
only_failed=False,
*,
origin: str | None,
task_ids: Collection[str | tuple[str, int]] | None = None,
recursive: bool = False,
confirmed: bool = False,
only_failed: bool = False,
session: Session = NEW_SESSION,
):
if confirmed:
Expand Down Expand Up @@ -2144,7 +2145,7 @@ def clear(self, *, session: Session = NEW_SESSION):
dag,
start_date,
end_date,
origin,
origin=origin,
task_ids=task_ids,
recursive=recursive,
confirmed=confirmed,
Expand All @@ -2164,7 +2165,8 @@ def clear(self, *, session: Session = NEW_SESSION):
]
)
@action_logging
def dagrun_clear(self):
@provide_session
def dagrun_clear(self, *, session: Session = NEW_SESSION):
"""Clears the DagRun"""
dag_id = request.form.get("dag_id")
dag_run_id = request.form.get("dag_run_id")
Expand All @@ -2182,6 +2184,7 @@ def dagrun_clear(self):
origin=None,
recursive=True,
confirmed=confirmed,
session=session,
)

@expose("/blocked", methods=["POST"])
Expand Down