superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grace...@apache.org
Subject [incubator-superset] branch master updated: fix since or until is empty value #4170 (#4176)
Date Wed, 10 Jan 2018 00:54:20 GMT
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 <yongjie.zhao@gmail.com>
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" <commits@superset.apache.org>'].

Mime
View raw message