Skip to content

Commit

Permalink
[bugfix] empty From date filter NoneType error (apache#3633)
Browse files Browse the repository at this point in the history
Error "AttributeError: 'NoneType' object has no attribute 'split'" is
fired.
  • Loading branch information
mistercrunch authored and michellethomas committed May 23, 2018
1 parent 01b1257 commit 2d6203d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions superset/viz.py
Expand Up @@ -158,10 +158,11 @@ def query_obj(self):
until = form_data.get("until", "now")

# Backward compatibility hack
since_words = since.split(' ')
grains = ['days', 'years', 'hours', 'day', 'year', 'weeks']
if (len(since_words) == 2 and since_words[1] in grains):
since += ' ago'
if since:
since_words = since.split(' ')
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)

Expand Down

0 comments on commit 2d6203d

Please sign in to comment.