mistercrunch commented on a change in pull request #6220: [SIP-5] Open a new 
/api/v1/query endpoint that takes query_obj
URL: 
https://github.com/apache/incubator-superset/pull/6220#discussion_r229832544
 
 

 ##########
 File path: superset/models/core.py
 ##########
 @@ -87,6 +87,37 @@ def copy_dashboard(mapper, connection, target):
     session.commit()
 
 
+def query_obj_backfill(form_data, datasource_id=None, datasource_type=None):
+    # Backfill query_obj. This will be generated on the client in the future.
+    # Note we unpack the metrics on the viz here so we can create the metrics
+    # dictionary during viz initialization without leveraging form_data.
+    #
+    # TODO: Note structure of the backfilled query_obj is temporary. It will be
+    # restructured as we build out the query object on the client side.
+    # The fields included are necessary to load a table viz without form_data
+    query_obj = {
+        'viz_type': form_data.get('viz_type', 'table'),
+        'time_range': form_data.get('time_range'),
+        'include_time': form_data.get('include_time'),
+        'token': form_data.get('token'),
 
 Review comment:
   I think a long time ago we used this to know whether the data came from 
cache or not and would define whether we needed to re-render the viz or not. I 
greped around and it looks unused at this point. Let's delete it.

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