codeant-ai-for-open-source[bot] commented on code in PR #44453:
URL: https://github.com/apache/superset/pull/44453#discussion_r4067487947


##########
superset/db_engine_specs/bigquery.py:
##########
@@ -706,12 +773,14 @@ def df_to_sql(
                 "project_id": engine.url.host,
             }
 
-        # Add credentials if they are set on the SQLAlchemy dialect.
-
+        # Add credentials if they are set on the SQLAlchemy dialect, or use the
+        # user's own OAuth2 token so uploads don't fall back to ADC.
         if creds := engine.dialect.credentials_info:
             to_gbq_kwargs["credentials"] = (
                 service_account.Credentials.from_service_account_info(creds)
             )
+        elif user_token := cls._get_oauth2_user_token(database):
+            to_gbq_kwargs["credentials"] = OAuth2Credentials(token=user_token)

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `61a8c97`.
   
   Uploads now reuse the authenticated client when `user_supplied_client` is 
true, even if service-account credentials remain configured. Service-account 
credentials are used only when no user-supplied client is active.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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