gemini-code-assist[bot] commented on code in PR #38950:
URL: https://github.com/apache/beam/pull/38950#discussion_r3404854394


##########
sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_client.py:
##########
@@ -29,50 +29,29 @@ class BigqueryV2(base_api.BaseApiClient):
 
   MESSAGES_MODULE = messages
   BASE_URL = 'https://bigquery.googleapis.com/bigquery/v2/'
-  MTLS_BASE_URL = 'https://www.mtls.googleapis.com/bigquery/v2/'
+  MTLS_BASE_URL = 'https://bigquery.mtls.googleapis.com/bigquery/v2/'
 
   _PACKAGE = 'bigquery'
-  _SCOPES = [
-      'https://www.googleapis.com/auth/bigquery',
-      'https://www.googleapis.com/auth/bigquery.insertdata',
-      'https://www.googleapis.com/auth/bigquery.readonly',
-      'https://www.googleapis.com/auth/cloud-platform',
-      'https://www.googleapis.com/auth/cloud-platform.read-only',
-      'https://www.googleapis.com/auth/devstorage.full_control',
-      'https://www.googleapis.com/auth/devstorage.read_only',
-      'https://www.googleapis.com/auth/devstorage.read_write'
-  ]
+  _SCOPES = ['https://www.googleapis.com/auth/bigquery', 
'https://www.googleapis.com/auth/bigquery.insertdata', 
'https://www.googleapis.com/auth/cloud-platform', 
'https://www.googleapis.com/auth/cloud-platform.read-only', 
'https://www.googleapis.com/auth/devstorage.full_control', 
'https://www.googleapis.com/auth/devstorage.read_only', 
'https://www.googleapis.com/auth/devstorage.read_write']
   _VERSION = 'v2'
-  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
-  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
+  _CLIENT_ID = 'CLIENT_ID'
+  _CLIENT_SECRET = 'CLIENT_SECRET'

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   The OAuth _CLIENT_ID and _CLIENT_SECRET have been replaced with the 
placeholder strings 'CLIENT_ID' and 'CLIENT_SECRET'. If any user flows or 
authentication mechanisms in Beam rely on these default client credentials (for 
example, when performing interactive user authentication), this change will 
break them.\n\nIf the generator script gen_client overrode these values, please 
consider passing the correct client ID and secret to the generator script 
(using --client_id and --client_secret flags) or restoring the original values.
   
   ```python
     _CLIENT_ID = '1042881264118.apps.googleusercontent.com'\n  _CLIENT_SECRET 
= 'x_Tw5K8nnjoRAqULM9PFAC2b'
   ```



##########
sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_client.py:
##########
@@ -29,50 +29,29 @@ class BigqueryV2(base_api.BaseApiClient):
 
   MESSAGES_MODULE = messages
   BASE_URL = 'https://bigquery.googleapis.com/bigquery/v2/'
-  MTLS_BASE_URL = 'https://www.mtls.googleapis.com/bigquery/v2/'
+  MTLS_BASE_URL = 'https://bigquery.mtls.googleapis.com/bigquery/v2/'
 
   _PACKAGE = 'bigquery'
-  _SCOPES = [
-      'https://www.googleapis.com/auth/bigquery',
-      'https://www.googleapis.com/auth/bigquery.insertdata',
-      'https://www.googleapis.com/auth/bigquery.readonly',
-      'https://www.googleapis.com/auth/cloud-platform',
-      'https://www.googleapis.com/auth/cloud-platform.read-only',
-      'https://www.googleapis.com/auth/devstorage.full_control',
-      'https://www.googleapis.com/auth/devstorage.read_only',
-      'https://www.googleapis.com/auth/devstorage.read_write'
-  ]
+  _SCOPES = ['https://www.googleapis.com/auth/bigquery', 
'https://www.googleapis.com/auth/bigquery.insertdata', 
'https://www.googleapis.com/auth/cloud-platform', 
'https://www.googleapis.com/auth/cloud-platform.read-only', 
'https://www.googleapis.com/auth/devstorage.full_control', 
'https://www.googleapis.com/auth/devstorage.read_only', 
'https://www.googleapis.com/auth/devstorage.read_write']

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   The scope 'https://www.googleapis.com/auth/bigquery.readonly' has been 
removed from _SCOPES. If this client is used in environments or with 
credentials that only have read-only access to BigQuery, removing this scope 
may cause authentication or authorization failures.\n\nAdditionally, this line 
is extremely long (345 characters), which violates PEP 8 line length limits. 
Please format this list across multiple lines to maintain readability.
   
   ```python
     _SCOPES = [\n      'https://www.googleapis.com/auth/bigquery',\n      
'https://www.googleapis.com/auth/bigquery.insertdata',\n      
'https://www.googleapis.com/auth/bigquery.readonly',\n      
'https://www.googleapis.com/auth/cloud-platform',\n      
'https://www.googleapis.com/auth/cloud-platform.read-only',\n      
'https://www.googleapis.com/auth/devstorage.full_control',\n      
'https://www.googleapis.com/auth/devstorage.read_only',\n      
'https://www.googleapis.com/auth/devstorage.read_write'\n  ]
   ```



##########
sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_client.py:
##########
@@ -92,11 +71,12 @@ class DatasetsService(base_api.BaseApiService):
     _NAME = 'datasets'
 
     def __init__(self, client):
-      super().__init__(client)
-      self._upload_configs = {}
+      super(BigqueryV2.DatasetsService, self).__init__(client)
+      self._upload_configs = {
+          }

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The super() call has been downgraded to the Python 2 style 
super(BigqueryV2.DatasetsService, self).__init__(client). Since Apache Beam 
Python SDK is Python 3 only, the simpler and cleaner super().__init__(client) 
is preferred.\n\nAdditionally, the empty dictionary _upload_configs is 
formatted across multiple lines, which is unnecessary and reduces 
readability.\n\nPlease consider running the project's standard code formatter 
(such as black or yapf) on this generated file to clean up these formatting 
anomalies, or configure the generator tool to output Python 3 compatible code.
   
   ```python
         super().__init__(client)\n      self._upload_configs = {}
   ```



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