yuqian90 commented on a change in pull request #6633: [AIRFLOW-2279] Clear 
tasks across DAGs if marked by ExternalTaskMarker
URL: https://github.com/apache/airflow/pull/6633#discussion_r358261867
 
 

 ##########
 File path: airflow/models/dag.py
 ##########
 @@ -950,6 +990,60 @@ def clear(
         if only_running:
             tis = tis.filter(TI.state == State.RUNNING)
 
+        if include_subdags:
+            # Recursively find external tasks indicated by ExternalTaskMarker
+            instances = tis.all()
+            for ti in instances:
+                if ti.operator == ExternalTaskMarker.__name__:
 
 Review comment:
   @ashb  Sure, will do. I have also moved the `import ExternalTaskMarker` 
inline into the `if` block like you recommended. Thank you!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to