impl(bigquery): add attach_job method to query client - #6295
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to configure a default Google Cloud project ID on the BigQuery client and adds an attach_job method to bind existing out-of-process query jobs. The feedback recommends refactoring the nested if-else block in attach_job using Rust's let-else syntax to reduce indentation, and replacing .unwrap() calls with .expect() in the new unit tests to adhere to the repository's style guide.
9ebfb67 to
f6fa4f4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6295 +/- ##
=======================================
Coverage 96.26% 96.27%
=======================================
Files 283 283
Lines 73009 73096 +87
=======================================
+ Hits 70279 70370 +91
+ Misses 2730 2726 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f6fa4f4 to
7f66bb6
Compare
|
|
||
| /// An invalid job reference was provided. | ||
| #[error("invalid job reference: {0}")] | ||
| InvalidJobReference(String), |
There was a problem hiding this comment.
I’m a little unsure about InvalidJobReference(String) here. Since the only validation failure we currently handle is a missing job_id, it feels more consistent with MissingProjectId to add a specific MissingJobId variant instead of a more generic error. Are there other errors that we are expecting will be encapsulated by this type?
|
|
||
| /// An invalid job reference was provided. | ||
| #[error("invalid job reference: {0}")] | ||
| InvalidJobReference(String), |
There was a problem hiding this comment.
I'm not sure if we should introduce another branch for missing information for Job. Maybe we should bundle MissingProjectId and InvalidJobReference into a BindingError ? I think that's how it's done in other veneers. Will check here and come back to that.
|
@suzmue @alvarowolfx I checked To keep things clean, I merged |
|
(drive by)
True. Calling it
It's bad but not sooo bad: https://github.com/googleapis/google-cloud-rust/pull/6253/changes |
Add
BigQuery::attach_jobto bind an existing out-of-process query job reference (JobReference) to a high-levelQueryhandle without re-submitting SQL.