superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: [line] improve feature (#4363)
Date Wed, 07 Feb 2018 22:33:06 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin 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 c4eba9e  [line] improve  feature (#4363)
c4eba9e is described below

commit c4eba9e4673ac44299d5639bf20e712486aaa023
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Wed Feb 7 14:33:04 2018 -0800

    [line] improve  feature (#4363)
    
    Require Since and Until parameter as they are needed to time shift
---
 superset/viz.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/superset/viz.py b/superset/viz.py
index c500276..ebd0c78 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1073,6 +1073,11 @@ class NVD3TimeSeriesViz(NVD3Viz):
             delta = utils.parse_human_timedelta(time_compare)
             query_object['inner_from_dttm'] = query_object['from_dttm']
             query_object['inner_to_dttm'] = query_object['to_dttm']
+
+            if not query_object['from_dttm'] or not query_object['to_dttm']:
+                raise Exception(_(
+                    '`Since` and `Until` time bounds should be specified '
+                    'when using the `Time Shift` feature.'))
             query_object['from_dttm'] -= delta
             query_object['to_dttm'] -= delta
 

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message