graceguo-supercat closed pull request #6251: [Fix] merge since, until request 
parameter with time_range
URL: https://github.com/apache/incubator-superset/pull/6251
 
 
   

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/views/core.py b/superset/views/core.py
index 9122b53a48..8501087aa0 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1032,6 +1032,15 @@ def get_form_data(self, slice_id=None, 
use_slice_data=False):
             slc = db.session.query(models.Slice).filter_by(id=slice_id).first()
             slice_form_data = slc.form_data.copy()
             # allow form_data in request override slice from_data
+            # special treat for since/until and time_range parameter:
+            # we need to breakdown time_range into since/until so request 
parameters
+            # has precedence over slice parameters for time fields.
+            if 'time_range' in form_data:
+                form_data['since'], separator, form_data['until'] = \
+                    form_data['time_range'].partition(' : ')
+            if 'time_range' in slice_form_data:
+                slice_form_data['since'], separator, slice_form_data['until'] 
= \
+                    slice_form_data['time_range'].partition(' : ')
             slice_form_data.update(form_data)
             form_data = slice_form_data
 


 

----------------------------------------------------------------
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