From 5dea6dab253656dd7fac6bd4199942e64b594efa Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 31 Aug 2017 13:59:40 -0700 Subject: [PATCH] [hotfix] user dashboard says '150 weeks' --- superset/viz.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index b7f1e6346e1b..3f973c7ed9bb 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -148,9 +148,8 @@ def query_obj(self): # Backward compatibility hack since_words = since.split(' ') - if ( - len(since_words) == 2 and - since_words[1] in ['days', 'years', 'hours', 'day', 'year']): + grains = ['days', 'years', 'hours', 'day', 'year', 'weeks'] + if (len(since_words) == 2 and since_words[1] in grains): since += ' ago' from_dttm = utils.parse_human_datetime(since)