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-195] : Add toggle support to subdag clearing in the CLI
Date Wed, 01 Jun 2016 00:45:06 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master 0a5364cd4 -> df8e331ef


[AIRFLOW-195] : Add toggle support to subdag clearing in the CLI


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

Branch: refs/heads/master
Commit: 115fe1c6b264c10319470a388c747caaf44a6dc4
Parents: 7678492
Author: Siddharth Anand <sanand@agari.com>
Authored: Mon May 30 22:37:28 2016 -0700
Committer: Siddharth Anand <sanand@agari.com>
Committed: Tue May 31 15:57:06 2016 -0700

----------------------------------------------------------------------
 airflow/bin/cli.py | 8 ++++++--
 tests/core.py      | 8 ++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/115fe1c6/airflow/bin/cli.py
----------------------------------------------------------------------
diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py
index 840c375..87400eb 100755
--- a/airflow/bin/cli.py
+++ b/airflow/bin/cli.py
@@ -407,7 +407,8 @@ def clear(args):
         end_date=args.end_date,
         only_failed=args.only_failed,
         only_running=args.only_running,
-        confirm_prompt=not args.no_confirm)
+        confirm_prompt=not args.no_confirm,
+        include_subdags=not args.exclude_subdags)
 
 
 def webserver(args):
@@ -714,6 +715,9 @@ class CLIFactory(object):
         'no_confirm': Arg(
             ("-c", "--no_confirm"),
             "Do not request confirmation", "store_true"),
+        'exclude_subdags': Arg(
+            ("-x", "--exclude_subdags"),
+            "Exclude subdags", "store_true"),
         # trigger_dag
         'run_id': Arg(("-r", "--run_id"), "Helps to identify this run"),
         'conf': Arg(
@@ -855,7 +859,7 @@ class CLIFactory(object):
             'args': (
                 'dag_id', 'task_regex', 'start_date', 'end_date', 'subdir',
                 'upstream', 'downstream', 'no_confirm', 'only_failed',
-                'only_running'),
+                'only_running', 'exclude_subdags'),
         }, {
             'func': pause,
             'help': "Pause a DAG",

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/115fe1c6/tests/core.py
----------------------------------------------------------------------
diff --git a/tests/core.py b/tests/core.py
index 80ad477..d5f33a1 100644
--- a/tests/core.py
+++ b/tests/core.py
@@ -693,6 +693,14 @@ class CliTests(unittest.TestCase):
         cli.unpause(args)
         assert self.dagbag.dags['example_bash_operator'].is_paused in [False, 0]
 
+    def test_subdag_clear(self):
+        args = self.parser.parse_args([
+            'clear', 'example_subdag_operator', '--no_confirm'])
+        cli.clear(args)
+        args = self.parser.parse_args([
+            'clear', 'example_subdag_operator', '--no_confirm', '--exclude_subdags'])
+        cli.clear(args)
+
     def test_backfill(self):
         cli.backfill(self.parser.parse_args([
             'backfill', 'example_bash_operator',


Mime
View raw message