graceguo-supercat commented on a change in pull request #9345: [explore view] 
fix long query issue from Run in SQL LAB Button
URL: 
https://github.com/apache/incubator-superset/pull/9345#discussion_r397632039
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -2743,19 +2743,30 @@ def _get_sqllab_payload(user_id: int) -> Dict[str, 
Any]:
             }
 
         return {
-            "defaultDbId": config["SQLLAB_DEFAULT_DBID"],
-            "common": common_bootstrap_payload(),
             "tab_state_ids": tabs_state,
             "active_tab": active_tab.to_dict() if active_tab else None,
             "databases": databases,
             "queries": queries,
         }
 
     @has_access
-    @expose("/sqllab")
+    @expose("/sqllab", methods=["GET", "POST"])
     def sqllab(self):
         """SQL Editor"""
-        payload = self._get_sqllab_payload(g.user.get_id())
+        payload = {
+            "defaultDbId": config["SQLLAB_DEFAULT_DBID"],
+            "common": common_bootstrap_payload(),
+        }
+
+        tabs_data = self._get_sqllab_tabs(g.user.get_id())
+        payload.update(tabs_data)
+
+        form_data = request.form.get("form_data")
+        if form_data:
+            try:
+                payload["requested_query"] = json.loads(form_data)
 
 Review comment:
   i prefer call it `requested_query` not form_data. form_data is used in 
dashboard and explore view, just feel this name is over loaded.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to