airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From san...@apache.org
Subject [1/2] incubator-airflow git commit: AIRFLOW-77: Enable UI toggle whether to apply 'clear' operation recursively to sub-DAGs or not
Date Tue, 17 May 2016 21:35:34 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master abc43c144 -> 4d8578398


AIRFLOW-77: Enable UI toggle whether to apply 'clear' operation recursively to sub-DAGs or
not


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/7a1fa7b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/7a1fa7b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/7a1fa7b1

Branch: refs/heads/master
Commit: 7a1fa7b1041dcb6fd9d6a4b536e76947293266b3
Parents: 181d373
Author: Waldemar Hummer <whummer@atlassian.com>
Authored: Mon May 9 10:21:22 2016 +1000
Committer: Waldemar Hummer <whummer@atlassian.com>
Committed: Mon May 9 12:04:24 2016 +1000

----------------------------------------------------------------------
 airflow/www/templates/airflow/dag.html | 5 +++++
 airflow/www/views.py                   | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/7a1fa7b1/airflow/www/templates/airflow/dag.html
----------------------------------------------------------------------
diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html
index b3bdd01..22b312e 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -148,6 +148,10 @@
               >
               Downstream
             </button>
+            <button id="btn_recursive"
+              type="button" class="btn active" data-toggle="button">
+               Recursive
+            </button>
           </span>
           <hr/>
           <button id="btn_success" type="button" class="btn btn-primary">
@@ -284,6 +288,7 @@ function updateQueryStringParameter(uri, key, value) {
         "&past=" + $('#btn_past').hasClass('active') +
         "&upstream=" + $('#btn_upstream').hasClass('active') +
         "&downstream=" + $('#btn_downstream').hasClass('active') +
+        "&recursive=" + $('#btn_recursive').hasClass('active') +
         "&execution_date=" + execution_date +
         "&origin=" + encodeURIComponent(window.location);
       window.location = url;

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/7a1fa7b1/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index f74be80..6962115 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1014,6 +1014,7 @@ class Airflow(BaseView):
         downstream = request.args.get('downstream') == "true"
         future = request.args.get('future') == "true"
         past = request.args.get('past') == "true"
+        recursive = request.args.get('recursive') == "true"
 
         dag = dag.sub_dag(
             task_regex=r"^{0}$".format(task_id),
@@ -1025,7 +1026,8 @@ class Airflow(BaseView):
         if confirmed:
             count = dag.clear(
                 start_date=start_date,
-                end_date=end_date)
+                end_date=end_date,
+                include_subdags=recursive)
 
             flash("{0} task instances have been cleared".format(count))
             return redirect(origin)
@@ -1033,6 +1035,7 @@ class Airflow(BaseView):
             tis = dag.clear(
                 start_date=start_date,
                 end_date=end_date,
+                include_subdags=recursive,
                 dry_run=True)
             if not tis:
                 flash("No task instances to clear", 'error')


Mime
View raw message