Skip to content

fix: BigFrames respects bq default region#16933

Merged
TrevorBergeron merged 3 commits intomainfrom
tbergeron_default_region_use
May 5, 2026
Merged

fix: BigFrames respects bq default region#16933
TrevorBergeron merged 3 commits intomainfrom
tbergeron_default_region_use

Conversation

@TrevorBergeron
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Copy link
Copy Markdown
Contributor

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

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 updates the session initialization to dynamically detect the default BigQuery location via a dry-run query when one isn't explicitly provided. A critical issue was identified in the implementation: query_and_wait does not support dry runs because it attempts to call .result() on the job. It is recommended to use the query method instead and to wrap the temporary BigQuery client in a context manager for proper resource handling.

Comment thread packages/bigframes/bigframes/session/__init__.py Outdated
@TrevorBergeron TrevorBergeron requested a review from tswast May 4, 2026 22:59
@TrevorBergeron TrevorBergeron added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 5, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 5, 2026
Copy link
Copy Markdown
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Thanks

) as temp_client:
row_iter = temp_client.query_and_wait(
"SELECT 1",
job_config=bigquery.QueryJobConfig(dry_run=True),
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.

Does dry run actually populate the location info? I suppose it should, but good to double-check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It does afaict from manual usage and the pre-existing integration test

@TrevorBergeron TrevorBergeron marked this pull request as ready for review May 5, 2026 17:23
@TrevorBergeron TrevorBergeron requested review from a team as code owners May 5, 2026 17:23
@TrevorBergeron TrevorBergeron requested review from GarrettWu and removed request for a team May 5, 2026 17:23
@TrevorBergeron TrevorBergeron merged commit ef9945a into main May 5, 2026
29 of 30 checks passed
@TrevorBergeron TrevorBergeron deleted the tbergeron_default_region_use branch May 5, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants