mistercrunch closed pull request #4363: [line] improve "Time Shift" feature URL: https://github.com/apache/incubator-superset/pull/4363
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/superset/viz.py b/superset/viz.py index 6fc8cf9887..c6d0760a8f 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -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 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services