dpgaspar commented on code in PR #30858:
URL: https://github.com/apache/superset/pull/30858#discussion_r1831461027


##########
superset/charts/data/api.py:
##########
@@ -394,8 +394,13 @@ def _process_data(query_data: Any) -> Any:
             )
 
         if result_format == ChartDataResultFormat.JSON:
+            queries = result["queries"]
+            if security_manager.is_guest_user():
+                for query in queries:
+                    with contextlib.suppress(KeyError):
+                        del query["query"]

Review Comment:
   nit, I think you could do:
   
   ``` python
   if security_manager.is_guest_user():
       for query in queries:
           query.pop("query", None)
   ```
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to