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

kaxilnaik pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-1-test by this push:
     new d338aa7  Fix Clear task instances endpoint resets all DAG runs bug 
(#17961)
d338aa7 is described below

commit d338aa785c309de0230234068cf9c5cc3dd3493b
Author: Yash Dodeja <[email protected]>
AuthorDate: Wed Sep 1 23:15:36 2021 +0530

    Fix Clear task instances endpoint resets all DAG runs bug (#17961)
    
    (cherry picked from commit 683fbd49d7873edd90632926e15d51d970aa00fb)
---
 airflow/api_connexion/endpoints/task_instance_endpoint.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/api_connexion/endpoints/task_instance_endpoint.py 
b/airflow/api_connexion/endpoints/task_instance_endpoint.py
index 51c48bd..3926b87 100644
--- a/airflow/api_connexion/endpoints/task_instance_endpoint.py
+++ b/airflow/api_connexion/endpoints/task_instance_endpoint.py
@@ -251,7 +251,7 @@ def post_clear_task_instances(dag_id: str, session=None):
     task_instances = dag.clear(get_tis=True, **data)
     if not data["dry_run"]:
         clear_task_instances(
-            task_instances, session, dag=dag, dag_run_state=State.RUNNING if 
reset_dag_runs else False
+            task_instances.all(), session, dag=dag, 
dag_run_state=State.RUNNING if reset_dag_runs else False
         )
     task_instances = task_instances.join(
         DR, and_(DR.dag_id == TI.dag_id, DR.execution_date == 
TI.execution_date)

Reply via email to