betodealmeida commented on code in PR #30858: URL: https://github.com/apache/superset/pull/30858#discussion_r1831455027
########## 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: This works too, `contextlib.supress` seems like using a canon to kill a fly. :) ```suggestion 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org