This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 60aa611f04 Remove option ot set a task instance to running state in UI 
(#36518)
60aa611f04 is described below

commit 60aa611f04559391621e7d0d9612cfffef6368a1
Author: Jens Scheffler <[email protected]>
AuthorDate: Fri Jan 5 13:02:34 2024 +0100

    Remove option ot set a task instance to running state in UI (#36518)
    
    * Remove option ot set a task instance to running state in UI
    * Uups, fix pytests
---
 airflow/www/views.py                | 10 ----------
 tests/www/views/test_views_tasks.py |  4 +---
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index 3e70fd7cbb..ee89bce509 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -5442,7 +5442,6 @@ class TaskInstanceModelView(AirflowModelView):
         "action_clear": "edit",
         "action_clear_downstream": "edit",
         "action_muldelete": "delete",
-        "action_set_running": "edit",
         "action_set_failed": "edit",
         "action_set_success": "edit",
         "action_set_retry": "edit",
@@ -5719,15 +5718,6 @@ class TaskInstanceModelView(AirflowModelView):
         except Exception:
             flash("Failed to set state", "error")
 
-    @action("set_running", "Set state to 'running'", "", single=False)
-    @auth.has_access_dag_entities("PUT", DagAccessEntity.TASK_INSTANCE)
-    @action_logging
-    def action_set_running(self, tis):
-        """Set state to 'running'."""
-        self.set_task_instance_state(tis, TaskInstanceState.RUNNING)
-        self.update_redirect()
-        return redirect(self.get_redirect())
-
     @action("set_failed", "Set state to 'failed'", "", single=False)
     @auth.has_access_dag_entities("PUT", DagAccessEntity.TASK_INSTANCE)
     @action_logging
diff --git a/tests/www/views/test_views_tasks.py 
b/tests/www/views/test_views_tasks.py
index 8cd257d89e..ae8ecfb78f 100644
--- a/tests/www/views/test_views_tasks.py
+++ b/tests/www/views/test_views_tasks.py
@@ -943,13 +943,12 @@ def test_task_instance_clear_failure(admin_client):
 @pytest.mark.parametrize(
     "action, expected_state",
     [
-        ("set_running", State.RUNNING),
         ("set_failed", State.FAILED),
         ("set_success", State.SUCCESS),
         ("set_retry", State.UP_FOR_RETRY),
         ("set_skipped", State.SKIPPED),
     ],
-    ids=["running", "failed", "success", "retry", "skipped"],
+    ids=["failed", "success", "retry", "skipped"],
 )
 def test_task_instance_set_state(session, admin_client, action, 
expected_state):
     task_id = "runme_0"
@@ -972,7 +971,6 @@ def test_task_instance_set_state(session, admin_client, 
action, expected_state):
 @pytest.mark.parametrize(
     "action",
     [
-        "set_running",
         "set_failed",
         "set_success",
         "set_retry",

Reply via email to