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

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


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new 28ad10fb813 fix cli clear command (#49631)
28ad10fb813 is described below

commit 28ad10fb8133fa8fc39e21dc23ac72de9bb7d17c
Author: Rahul Vats <[email protected]>
AuthorDate: Fri Apr 25 14:49:58 2025 +0530

    fix cli clear command (#49631)
    
    https://github.com/apache/airflow/issues/49618
    (cherry picked from commit 3f0e48079b777c1691f417e4ed72fa3c18de4ba1)
---
 airflow-core/src/airflow/models/dag.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/airflow-core/src/airflow/models/dag.py 
b/airflow-core/src/airflow/models/dag.py
index c09ddaf5b63..57c1050e3ce 100644
--- a/airflow-core/src/airflow/models/dag.py
+++ b/airflow-core/src/airflow/models/dag.py
@@ -1455,6 +1455,8 @@ class DAG(TaskSDKDag, LoggingMixin):
     ):
         all_tis = []
         for dag in dags:
+            if not isinstance(dag, DAG):
+                dag = DAG.from_sdk_dag(dag)
             tis = dag.clear(
                 start_date=start_date,
                 end_date=end_date,
@@ -1481,6 +1483,8 @@ class DAG(TaskSDKDag, LoggingMixin):
 
         if do_it:
             for dag in dags:
+                if not isinstance(dag, DAG):
+                    dag = DAG.from_sdk_dag(dag)
                 dag.clear(
                     start_date=start_date,
                     end_date=end_date,

Reply via email to