eschutho commented on a change in pull request #18722:
URL: https://github.com/apache/superset/pull/18722#discussion_r810265646



##########
File path: superset/views/base.py
##########
@@ -366,6 +368,12 @@ def common_bootstrap_payload() -> Dict[str, Any]:
             ReportRecipientType.EMAIL,
         ]
 
+    available_specs = get_available_engine_specs()
+    if available_specs[GSheetsEngineSpec]:
+        frontend_config["SHOW_GLOBAL_GSHEETS"] = True
+    else:
+        frontend_config["SHOW_GLOBAL_GSHEETS"] = False

Review comment:
       can this by dry-ed up a bit by something like: 
   ```
   available_specs = get_available_engine_specs()
   
frontend_config["SHOW_GLOBAL_GSHEETS"]=bool(available_specs[GSheetsEngineSpec])
   ```
   Also nit, but can we decouple the backend config by naming this something 
more generic perhaps? Since the value is whether the driver is installed, the 
backend doesn't need to know how the client side is using this value, i.e., 
whether to show gsheets globally, just needs to know that the driver is 
installed. 




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