msyavuz commented on code in PR #37939:
URL: https://github.com/apache/superset/pull/37939#discussion_r2800279664
##########
superset/db_engine_specs/gsheets.py:
##########
@@ -203,13 +203,18 @@ def needs_oauth2(cls, ex: Exception) -> bool:
In case the token was manually revoked on Google side, `google-auth`
will
try to automatically refresh credentials, but it fails since it only
has the
access token. This override catches this scenario as well.
+
+ Also catches the case where no credentials are configured at all
+ (missing Application Default Credentials).
"""
+ error_message = str(ex)
return (
g
and hasattr(g, "user")
and (
isinstance(ex, cls.oauth2_exception)
- or "credentials do not contain the necessary fields" in str(ex)
+ or "credentials do not contain the necessary fields" in
error_message
+ or "default credentials were not found" in
error_message.lower()
Review Comment:
Should the error_message itself be lowercase?
--
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]