Skip to content

Commit

Permalink
[line] improve feature
Browse files Browse the repository at this point in the history
Require Since and Until parameter as they are needed to time shift
  • Loading branch information
mistercrunch committed Feb 7, 2018
1 parent 19a0827 commit 05d2058
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,11 @@ def get_data(self, df):
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

Expand Down

0 comments on commit 05d2058

Please sign in to comment.