From commits-return-508-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Wed Jan 10 01:54:25 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 86DB7180718 for ; Wed, 10 Jan 2018 01:54:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 76CF4160C40; Wed, 10 Jan 2018 00:54:25 +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 C4A78160C17 for ; Wed, 10 Jan 2018 01:54:24 +0100 (CET) Received: (qmail 56426 invoked by uid 500); 10 Jan 2018 00:54:24 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 56417 invoked by uid 99); 10 Jan 2018 00:54:24 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jan 2018 00:54:24 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 72B3D8073A; Wed, 10 Jan 2018 00:54:20 +0000 (UTC) Date: Wed, 10 Jan 2018 00:54:20 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: fix since or until is empty value #4170 (#4176) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151554566071.7343.4098329475928435133@gitbox.apache.org> From: graceguo@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 23c98294bdc1ba9b09e97f821253570f48990795 X-Git-Newrev: e182f7f96227ef699c1e55c43bb97f8df2fa5f12 X-Git-Rev: e182f7f96227ef699c1e55c43bb97f8df2fa5f12 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. graceguo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new e182f7f fix since or until is empty value #4170 (#4176) e182f7f is described below commit e182f7f96227ef699c1e55c43bb97f8df2fa5f12 Author: Yongjie Zhao AuthorDate: Wed Jan 10 08:54:18 2018 +0800 fix since or until is empty value #4170 (#4176) --- superset/viz.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index a97b04e..8bb6582 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -173,8 +173,10 @@ class BaseViz(object): self.time_shift = utils.parse_human_timedelta(time_shift) - from_dttm = utils.parse_human_datetime(since) - self.time_shift - to_dttm = utils.parse_human_datetime(until) - self.time_shift + since = utils.parse_human_datetime(since) + until = utils.parse_human_datetime(until) + from_dttm = None if since is None else (since - self.time_shift) + to_dttm = None if until is None else (until - self.time_shift) if from_dttm and to_dttm and from_dttm > to_dttm: raise Exception(_('From date cannot be larger than to date')) -- To stop receiving notification emails like this one, please contact ['"commits@superset.apache.org" '].