Skip to content

docs(bigquery): improve Query handles docs - #6212

Draft
alvarowolfx wants to merge 3 commits into
googleapis:mainfrom
alvarowolfx:docs-bq-query-handles
Draft

docs(bigquery): improve Query handles docs#6212
alvarowolfx wants to merge 3 commits into
googleapis:mainfrom
alvarowolfx:docs-bq-query-handles

Conversation

@alvarowolfx

Copy link
Copy Markdown
Contributor

Towards #5844

@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Jul 29, 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 adds comprehensive documentation and usage examples to the Query, CompleteQuery, and RunQuery structs in the BigQuery query module. The feedback points out incorrect import paths for QueryReference in the newly added documentation and examples, which would cause broken intra-doc links and rustdoc warnings.

Comment on lines +68 to +72
/// Returns the [`QueryReference`](crate::model::QueryReference) identifying this query execution.
///
/// The reference will be [`QueryReference::Job`] with a query [job reference],
/// or [`QueryReference::Stateless`] with an opaque query ID if job creation
/// was skipped.
/// The reference will be [`QueryReference::Job`](crate::model::QueryReference::Job) containing a BigQuery Query [job reference]
/// if a job was created, or [`QueryReference::Stateless`](crate::model::QueryReference::Stateless) with an opaque
/// query ID if the execution ran statelessly via [jobs.query].

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.

medium

The QueryReference type is imported from crate::query::QueryReference (defined in src/bigquery/src/query/query_reference.rs), not crate::model::QueryReference. Using the incorrect path will result in broken intra-doc links and rustdoc warnings, which can fail the CI build.

Suggested change
/// Returns the [`QueryReference`](crate::model::QueryReference) identifying this query execution.
///
/// The reference will be [`QueryReference::Job`] with a query [job reference],
/// or [`QueryReference::Stateless`] with an opaque query ID if job creation
/// was skipped.
/// The reference will be [`QueryReference::Job`](crate::model::QueryReference::Job) containing a BigQuery Query [job reference]
/// if a job was created, or [`QueryReference::Stateless`](crate::model::QueryReference::Stateless) with an opaque
/// query ID if the execution ran statelessly via [jobs.query].
/// Returns the [`QueryReference`](crate::query::QueryReference) identifying this query execution.
///
/// The reference will be [`QueryReference::Job`](crate::query::QueryReference::Job) containing a BigQuery Query [job reference]
/// if a job was created, or [`QueryReference::Stateless`](crate::query::QueryReference::Stateless) with an opaque
/// query ID if the execution ran statelessly via [jobs.query].
References
  1. Always verify that Rust documentation compiles without warnings (e.g., by running cargo doc) before merging, because rustdoc warnings (such as bare URLs or unresolved links) will fail CI builds that enforce -D warnings.

/// ```
/// # async fn sample() -> anyhow::Result<()> {
/// use google_cloud_bigquery::client::BigQuery;
/// use google_cloud_bigquery::model::QueryReference;

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.

medium

Update the import path in the example to use query instead of model to match where QueryReference is exported.

Suggested change
/// use google_cloud_bigquery::model::QueryReference;
/// use google_cloud_bigquery::query::QueryReference;

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.06%. Comparing base (210fed0) to head (32e92a7).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6212   +/-   ##
=======================================
  Coverage   96.06%   96.06%           
=======================================
  Files         268      268           
  Lines       67175    67175           
=======================================
  Hits        64534    64534           
  Misses       2641     2641           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant