You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tarun-google (via GitHub)" <gi...@apache.org> on 2026/06/12 16:41:00 UTC
[PR] Update Bigquery Client [beam]
tarun-google opened a new pull request, #38950:
URL: https://github.com/apache/beam/pull/38950
Prerequisite to fix https://github.com/apache/beam/issues/34075
Updated with the script
` gen_client --discovery_url="https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest" --overwrite --outdir=sdks/python/apache_beam/io/gcp/internal/clients/bigquery --root_package=apache_beam.io.gcp.internal.clients.bigquery client`
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #38950:
URL: https://github.com/apache/beam/pull/38950
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38950:
URL: https://github.com/apache/beam/pull/38950#issuecomment-4695485345
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment `assign set of reviewers`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #38950:
URL: https://github.com/apache/beam/pull/38950#issuecomment-4693281153
## Summary of Changes
Hello, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request updates the BigQuery client library within the Apache Beam codebase by regenerating it from the latest discovery document. The primary purpose of this change is to ensure the client remains synchronized with the current BigQuery API surface, incorporating recent updates to endpoint paths and adding missing documentation regarding required IAM permissions for specific operations.
### Highlights
* **Client Regeneration**: Regenerated the BigQuery client library using the standard gen_client script to ensure alignment with the latest API discovery document.
* **API Configuration Updates**: Updated API method configurations, including the addition of flat_path definitions and the transition to using expanded path parameters for better compatibility.
* **IAM Documentation**: Added detailed IAM permission requirements to the docstrings of various API methods to improve developer clarity and security auditing.
* **New API Methods**: Introduced new API methods such as dataset undeletion, job deletion, and expanded row access policy management.
<details>
<summary><b>New Features</b></summary>
🧠You can now enable **Memory** (public preview) to help **Gemini Code Assist** learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. **Click [here](https://codeassist.google/code-review/login) to enable Memory in your admin console.**
</details>
<details>
<summary><b>Using Gemini Code Assist</b></summary>
<br>
The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
<b>Invoking Gemini</b>
You can request assistance from Gemini at any point by creating a comment using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands on the current page.
Feature | Command | Description
--- | --- | ---
Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help | `/gemini help` | Displays a list of available commands.
<b>Customization</b>
To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
<b>Limitations & Feedback</b>
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
</details>
[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
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:

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:

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:

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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "tarun-google (via GitHub)" <gi...@apache.org>.
tarun-google commented on code in PR #38950:
URL: https://github.com/apache/beam/pull/38950#discussion_r3404873572
##########
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:
what are these secrets? why are we publishing them?
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "tarun-google (via GitHub)" <gi...@apache.org>.
tarun-google commented on PR #38950:
URL: https://github.com/apache/beam/pull/38950#issuecomment-4695468304
Run Python_ML PreCommit 3.13
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "derrickaw (via GitHub)" <gi...@apache.org>.
derrickaw commented on PR #38950:
URL: https://github.com/apache/beam/pull/38950#issuecomment-4916305216
Hi @Abacn, please take a look at your convenience. Thanks
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38950:
URL: https://github.com/apache/beam/pull/38950#issuecomment-4694265801
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "tarun-google (via GitHub)" <gi...@apache.org>.
tarun-google commented on PR #38950:
URL: https://github.com/apache/beam/pull/38950#issuecomment-4695477908
R: @Abacn
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Update Bigquery Client [beam]
Posted by "tarun-google (via GitHub)" <gi...@apache.org>.
tarun-google commented on code in PR #38950:
URL: https://github.com/apache/beam/pull/38950#discussion_r3404868842
##########
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:
I do not see 'https://www.googleapis.com/auth/bigquery.readonly' referenced in https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org