docs(bigquery): add core job lifecycle samples - #6340
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces BigQuery job examples, including creating, getting, listing, and cancelling jobs, along with corresponding integration tests. The feedback suggests a minor refactoring in list_jobs.rs to make the pagination logic more idiomatic by replacing an unnecessary match Some(...) with a simpler if condition.
fb7cfc9 to
245d2a3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6340 +/- ##
=======================================
Coverage 96.10% 96.10%
=======================================
Files 282 282
Lines 73304 73304
=======================================
Hits 70449 70449
Misses 2855 2855 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| if e.to_string().contains("Root element must be a message") { | ||
| // NOTE: A known issue in protobuf/gax serialization for empty POSTs. |
There was a problem hiding this comment.
Hmmm I thought we fixed this bug.
| .send() | ||
| .await?; |
There was a problem hiding this comment.
.into_job_poller().until_done().await ?
| // Wait for the job to complete | ||
| loop { |
There was a problem hiding this comment.
I thought you made this easier.
| if !page_token.is_empty() { | ||
| req = req.set_page_token(page_token); | ||
| } | ||
| let res = req.send().await?; |
There was a problem hiding this comment.
We have a .by_item() helper so customers dont have to write this loop.
https://googleapis.github.io/google-cloud-rust/pagination.html
Demonstrate how to manage the lifecycle of BigQuery Jobs. These samples poll
JobServiceto track status and metadata.Added:
bigquery_create_job: Creates and executes a job.bigquery_get_job: Retrieves the execution status and metadata of a job by its ID.bigquery_list_jobs: Lists recently executed jobs in the project.bigquery_cancel_job: Cancels an active analytical query job.