Repository: incubator-airflow Updated Branches: refs/heads/master b93e6519c -> 4e550cb9e
[AIRFLOW-347] Show empty DAG runs in tree view Use DAG runs to construct the list of dates to display in the tree view. The old logic used execution dates from task instances to construct the list of dates, which meant that empty DAG runs would not show up. Closes #1892 from vijaysbhat/tree_view_empty_dag_runs Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/4e550cb9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/4e550cb9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/4e550cb9 Branch: refs/heads/master Commit: 4e550cb9e37d2896d1c3e40ed20cc15428d86d09 Parents: b93e651 Author: Vijay Bhat <[email protected]> Authored: Sat Nov 19 09:44:41 2016 -0800 Committer: Siddharth Anand <[email protected]> Committed: Sat Nov 19 09:44:47 2016 -0800 ---------------------------------------------------------------------- airflow/www/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/4e550cb9/airflow/www/views.py ---------------------------------------------------------------------- diff --git a/airflow/www/views.py b/airflow/www/views.py index d3857df..c4f4bd7 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -1221,10 +1221,11 @@ class Airflow(BaseView): dag_runs = { dr.execution_date: alchemy_to_dict(dr) for dr in dag_runs} + dates = sorted(list(dag_runs.keys())) + max_date = max(dates) if dates else None + tis = dag.get_task_instances( session, start_date=min_date, end_date=base_date) - dates = sorted(list({ti.execution_date for ti in tis})) - max_date = max([ti.execution_date for ti in tis]) if dates else None task_instances = {} for ti in tis: tid = alchemy_to_dict(ti)
