Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F420B200C52 for ; Mon, 10 Apr 2017 23:28:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EF452160BA5; Mon, 10 Apr 2017 21:28:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 42580160B7F for ; Mon, 10 Apr 2017 23:28:22 +0200 (CEST) Received: (qmail 78357 invoked by uid 500); 10 Apr 2017 21:28:21 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 78343 invoked by uid 99); 10 Apr 2017 21:28:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 21:28:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B8DA8180535 for ; Mon, 10 Apr 2017 21:28:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id LRH_W_abbKDg for ; Mon, 10 Apr 2017 21:28:18 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id B23235F5CA for ; Mon, 10 Apr 2017 21:28:17 +0000 (UTC) Received: (qmail 78029 invoked by uid 99); 10 Apr 2017 21:28:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 21:28:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A9D6EEE68D; Mon, 10 Apr 2017 21:28:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: criccomini@apache.org To: commits@airflow.incubator.apache.org Date: Mon, 10 Apr 2017 21:28:17 -0000 Message-Id: <3aeeb9c502e34c19818a63b01f9d0f68@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/4] incubator-airflow git commit: [AIRFLOW-1001] Fix landing times if there is no following schedule archived-at: Mon, 10 Apr 2017 21:28:23 -0000 [AIRFLOW-1001] Fix landing times if there is no following schedule @once does not have a following schedule. This was not checked for and therefore the landing times page could bork. Closes #2213 from bolkedebruin/AIRFLOW-1001 (cherry picked from commit 0371df4f1bd78e220e591d5cb23630d6a062f109) Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/c94b3a02 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/c94b3a02 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/c94b3a02 Branch: refs/heads/v1-8-test Commit: c94b3a02f430f1a5a86c83d5f7286dcdac31492b Parents: aec9770 Author: Bolke de Bruin Authored: Wed Apr 5 09:57:55 2017 +0200 Committer: Chris Riccomini Committed: Mon Apr 10 14:19:53 2017 -0700 ---------------------------------------------------------------------- airflow/www/views.py | 2 +- tests/core.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c94b3a02/airflow/www/views.py ---------------------------------------------------------------------- diff --git a/airflow/www/views.py b/airflow/www/views.py index 962c1f0..fec4779 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -1553,7 +1553,7 @@ class Airflow(BaseView): for ti in task.get_task_instances(session, start_date=min_date, end_date=base_date): ts = ti.execution_date - if dag.schedule_interval: + if dag.schedule_interval and dag.following_schedule(ts): ts = dag.following_schedule(ts) if ti.end_date: dttm = wwwutils.epoch(ti.execution_date) http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c94b3a02/tests/core.py ---------------------------------------------------------------------- diff --git a/tests/core.py b/tests/core.py index 870a0cb..c55b1e2 100644 --- a/tests/core.py +++ b/tests/core.py @@ -1413,6 +1413,7 @@ class WebUiTests(unittest.TestCase): self.dag_bash2 = self.dagbag.dags['test_example_bash_operator'] self.sub_dag = self.dagbag.dags['example_subdag_operator'] self.runme_0 = self.dag_bash.get_task('runme_0') + self.example_xcom = self.dagbag.dags['example_xcom'] self.dag_bash2.create_dagrun( run_id="test_{}".format(models.DagRun.id_for_date(datetime.now())), @@ -1428,6 +1429,13 @@ class WebUiTests(unittest.TestCase): state=State.RUNNING ) + self.example_xcom.create_dagrun( + run_id="test_{}".format(models.DagRun.id_for_date(datetime.now())), + execution_date=DEFAULT_DATE, + start_date=datetime.now(), + state=State.RUNNING + ) + def test_index(self): response = self.app.get('/', follow_redirects=True) assert "DAGs" in response.data.decode('utf-8') @@ -1473,8 +1481,12 @@ class WebUiTests(unittest.TestCase): assert "example_bash_operator" in response.data.decode('utf-8') response = self.app.get( '/admin/airflow/landing_times?' - 'days=30&dag_id=example_bash_operator') - assert "example_bash_operator" in response.data.decode('utf-8') + 'days=30&dag_id=test_example_bash_operator') + assert "test_example_bash_operator" in response.data.decode('utf-8') + response = self.app.get( + '/admin/airflow/landing_times?' + 'days=30&dag_id=example_xcom') + assert "example_xcom" in response.data.decode('utf-8') response = self.app.get( '/admin/airflow/gantt?dag_id=example_bash_operator') assert "example_bash_operator" in response.data.decode('utf-8')