You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by gr...@apache.org on 2018/01/10 00:54:20 UTC

[incubator-superset] branch master updated: fix since or until is empty value #4170 (#4176)

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 <yo...@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" <co...@superset.apache.org>'].