Skip to content

docs(bigquery/bigframes): add query_dry_run code sample - #14507

Closed
shuoweil wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
shuoweil:shuowei-bigframes-query-dry-run
Closed

docs(bigquery/bigframes): add query_dry_run code sample#14507
shuoweil wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
shuoweil:shuowei-bigframes-query-dry-run

Conversation

@shuoweil

Copy link
Copy Markdown
Contributor

Description

Adds a BigQuery DataFrames (bigframes) code sample demonstrating how to execute a query dry run to estimate bytes processed without running the actual query, targeting the documentation page bigquery-query-dry-run.

Fixes b/546160994 (Subtask of b/522898394)

Summary of Changes

  • New Sample: Added bigquery/bigframes/query_dry_run.py showing how to perform a dry run using session.bqclient.query(sql, job_config=job_config) to inspect query_job.total_bytes_processed.

@shuoweil
shuoweil requested review from a team and tswast as code owners August 13, 2026 21:24
@snippet-bot

snippet-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples. labels Aug 13, 2026

@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 introduces a new code sample and test for performing a BigQuery dry run query using BigQuery DataFrames. The feedback suggests removing an unnecessary global configuration for ordering_mode since no DataFrame operations are executed, and adding a safety check for query_job.total_bytes_processed to handle cases where it might be None and ensure type safety.

Comment thread bigquery/bigframes/query_dry_run.py Outdated
Comment thread bigquery/bigframes/query_dry_run.py Outdated
shuoweil and others added 2 commits August 13, 2026 16:10
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@shuoweil

Copy link
Copy Markdown
Contributor Author

Will check in the code change in Git-on-Borg.

@shuoweil shuoweil closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant