From 34d4bdb215a9c9fd89afd54e07f29f1d2b07435e Mon Sep 17 00:00:00 2001 From: Mike Kerzhner Date: Wed, 23 Sep 2015 14:14:19 -0700 Subject: [PATCH 1/2] Changing the default base date of the tree view --- airflow/www/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/www/app.py b/airflow/www/app.py index 21ea7771a04c6..5864268ac2af2 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -1055,7 +1055,7 @@ def tree(self): num_runs = int(num_runs) if num_runs else 25 if not base_date: - base_date = dag.latest_execution_date or datetime.now() + base_date = (dag.latest_execution_date + 2 * dag.schedule_interval) or datetime.now() else: base_date = dateutil.parser.parse(base_date) base_date = utils.round_time(base_date, dag.schedule_interval) From 8f642753fb701801aad5d23ec2006697b3657335 Mon Sep 17 00:00:00 2001 From: Mike Kerzhner Date: Thu, 24 Sep 2015 10:41:38 -0700 Subject: [PATCH 2/2] Properly treating new DAGs in Tree View --- airflow/www/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airflow/www/app.py b/airflow/www/app.py index 5864268ac2af2..ee546dadb261e 100644 --- a/airflow/www/app.py +++ b/airflow/www/app.py @@ -1055,7 +1055,11 @@ def tree(self): num_runs = int(num_runs) if num_runs else 25 if not base_date: - base_date = (dag.latest_execution_date + 2 * dag.schedule_interval) or datetime.now() + # New DAGs will not have a latest execution date + if dag.latest_execution_date: + base_date = dag.latest_execution_date + 2 * dag.schedule_interval + else: + base_date = datetime.now() else: base_date = dateutil.parser.parse(base_date) base_date = utils.round_time(base_date, dag.schedule_interval)