claudevdm commented on code in PR #39203:
URL: https://github.com/apache/beam/pull/39203#discussion_r3918356159


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java:
##########
@@ -1738,6 +1739,27 @@ private static boolean nextBackOff(Sleeper sleeper, 
BackOff backoff) throws Inte
     }
   }
 
+  /**
+   * Returns credentials with the quota project applied, if one is configured 
and the credentials
+   * support it. The quota project sets the {@code X-Goog-User-Project} header 
so that BigQuery API
+   * requests are billed against that project's quota.
+   */
+  @VisibleForTesting
+  static @Nullable Credentials maybeWithQuotaProjectId(

Review Comment:
   Is this safe from caching? Should we rather set the header directly in the 
newBigQueryClient initBuilder? 



##########
sdks/python/apache_beam/internal/gcp/auth.py:
##########
@@ -82,6 +82,59 @@ def get_service_credentials(pipeline_options):
   return _Credentials.get_service_credentials(pipeline_options)
 
 
+def with_quota_project(credentials, quota_project_id):

Review Comment:
   Cache _quota_credentials  same as _credentials?



##########
sdks/python/apache_beam/io/gcp/bigquery_read_internal.py:
##########


Review Comment:
   Use transform level quota_project_id?



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

Reply via email to