Skip to content

[Gemini] Migrate Python BigQuery off of apitools client#39087

Draft
jrmccluskey wants to merge 18 commits into
apache:masterfrom
jrmccluskey:bqMigration
Draft

[Gemini] Migrate Python BigQuery off of apitools client#39087
jrmccluskey wants to merge 18 commits into
apache:masterfrom
jrmccluskey:bqMigration

Conversation

@jrmccluskey

Copy link
Copy Markdown
Contributor

Migrates the BQ client to the supported Python library and off of the deprecated apitools client.

DO NOT MERGE - needs internal testing


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@jrmccluskey

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the Apache Beam Python SDK's BigQuery integration from the legacy apitools client to the official google-cloud-bigquery library. The feedback highlights several critical issues and regressions introduced during this migration. Specifically, manual base64 encoding of bytes should be removed as the new client handles this natively, and broad exception-swallowing during table and dataset deletions should be avoided to prevent hiding critical errors. Additionally, several redundant try-except blocks, a leftover debug print statement, and an ad-hoc MockJob implementation on conflict should be cleaned up.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread sdks/python/apache_beam/io/gcp/big_query_query_to_table_it_test.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_tools.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_tools.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_file_loads.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_tools.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_tools.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_tools.py Outdated
Comment thread sdks/python/apache_beam/io/gcp/bigquery_tools.py Outdated
jrmccluskey and others added 4 commits June 26, 2026 14:07
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant