betodealmeida commented on code in PR #37398:
URL: https://github.com/apache/superset/pull/37398#discussion_r2722136597
##########
superset/db_engine_specs/gsheets.py:
##########
@@ -335,9 +407,19 @@ def validate_parameters(
return errors
try:
+ url = url.replace('"', '""')
results = conn.execute(f'SELECT * FROM "{url}" LIMIT 1') #
noqa: S608
results.fetchall()
except Exception: # pylint: disable=broad-except
+ # OAuth2 connection check
+ # Check `parameters` first (used by frontend during form
validation)
+ if parameters.get("oauth2_client_info"):
+ continue
+ # Check `masked_encrypted_extra` (for create/update events)
+ encrypted =
json.loads(properties.get("masked_encrypted_extra", "{}"))
Review Comment:
It's better to move this call outside of the loop (and maybe the one in
416), so that we don't need to run `json.loads()` for every table in the
catalog.
--
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]