uranusjr commented on a change in pull request #19353:
URL: https://github.com/apache/airflow/pull/19353#discussion_r747320869
##########
File path: airflow/www/views.py
##########
@@ -3977,26 +3978,36 @@ class
DagRunModelView(AirflowPrivilegeVerifierModelView):
@action('muldelete', "Delete", "Are you sure you want to delete selected
records?", single=False)
@action_has_dag_edit_access
- @provide_session
- def action_muldelete(self, items, session=None):
+ def action_muldelete(self, items: List[DagRun]):
"""Multiple delete."""
self.datamodel.delete_all(items)
self.update_redirect()
return redirect(self.get_redirect())
+ @action('set_queued', "Set state to 'queued'", '', single=False)
+ @action_has_dag_edit_access
+ def action_set_queued(self, drs: List[DagRun]):
+ """Set state to queued."""
+ return self._set_dag_runs_to_active_state(drs, State.QUEUED)
+
@action('set_running', "Set state to 'running'", '', single=False)
@action_has_dag_edit_access
- @provide_session
- def action_set_running(self, drs, session=None):
+ def action_set_running(self, drs: List[DagRun]):
"""Set state to running."""
+ return self._set_dag_runs_to_active_state(drs, State.RUNNING)
+
+ @provide_session
+ def _set_dag_runs_to_active_state(self, drs: List[DagRun], state: str,
session=None):
+ """This routine only support Running and Queued state."""
Review comment:
```suggestion
"""This routine only supports Running and Queued state."""
```
--
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]