betodealmeida commented on a change in pull request #6269: Fixing time range 
since with no "ago"
URL: 
https://github.com/apache/incubator-superset/pull/6269#discussion_r230891730
 
 

 ##########
 File path: superset/utils/core.py
 ##########
 @@ -923,6 +923,15 @@ def get_since_until(form_data):
         time_range = form_data['time_range']
         if separator in time_range:
             since, until = time_range.split(separator, 1)
+            # Backward compatibility hack
+            if since and since not in common_time_frames:
+                since_words = since.split(' ')
+                grains = ['days', 'years', 'hours', 'day', 'year', 'weeks']
+                if (len(since_words) == 2 and since_words[1] in grains):
+                    since += ' ago'
+            # Handling 'No filter' default getting added as since
+            if since == 'No filter':
+                since = None
 
 Review comment:
   We should also set until to None here, no?
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to