-
Notifications
You must be signed in to change notification settings - Fork 69
feat: handle auto pagination for BigQuery v2 #3829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm unsure which checks are relevant/needed. Please let me know, |
/gcbrun |
PAGINATE_MAX_RESULT_TYPES = | ||
ImmutableMap.of( | ||
"com.google.cloud.bigquery.v2", | ||
ImmutableMap.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there are some legacy RPCs use max_results
field and are not of wrapper types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are total of 4 types. 2 wrapper types [UINT32VALUE, INT32VALUE] and 2 non wrapper type [uint32, int32].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think my question is more like do we need the value of the map to be another map (compared to a set) that contains the actual types? Looks like all the legacy RPCs are using wrapper types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. PTAL.
PAGINATE_MAX_RESULT_TYPES = | ||
ImmutableMap.of( | ||
"com.google.cloud.bigquery.v2", | ||
ImmutableMap.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are total of 4 types. 2 wrapper types [UINT32VALUE, INT32VALUE] and 2 non wrapper type [uint32, int32].
Path serviceYamlPath = Paths.get(testFilesDirectory, serviceYamlFilename); | ||
Optional<com.google.api.Service> serviceYamlOpt = | ||
ServiceYamlParser.parse(serviceYamlPath.toString()); | ||
assertTrue(serviceYamlOpt.isPresent()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think service yaml and service config json may not be required in this case? Can we pass empty ones to simplify the test cas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted service.yaml but it seems like config json is still needed.
PAGINATE_MAX_RESULT_TYPES = | ||
ImmutableMap.of( | ||
"com.google.cloud.bigquery.v2", | ||
ImmutableMap.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think my question is more like do we need the value of the map to be another map (compared to a set) that contains the actual types? Looks like all the legacy RPCs are using wrapper types.
@@ -149,6 +149,23 @@ public abstract class AbstractServiceStubSettingsClassComposer implements ClassC | |||
|
|||
private final TransportContext transportContext; | |||
|
|||
// Maps of package->methodName to types for pagination with max_results field. | |||
private static final ImmutableMap<String, ImmutableMap<String, TypeNode>> | |||
PAGINATE_MAX_RESULT_TYPES = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the name of this static field more bigquery specific? Same comment for PAGINATION_MAX_RESULTS_SERVICES_ALLOWLIST
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. PTAL.
I've also updated the dictionary to be a single map of types instead of map to map. Using a set is not possible because unwrapping requires to differentiate the 2 wrapper types.
// in reverse chronological order, by job creation time. Requires the Can View | ||
// project role, or the Is Owner project role if you set the allUsers | ||
// property. | ||
rpc ListJobs(ListJobsRequest) returns (JobList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding another test case here that is outside of the hardcoded list? To prove that other RPCs are not affected even if they are under the bigquery namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added deleteJob rpc as additional test case. PTAL.
@blakeli0 , thank you for the review. I've updated the PR to include your suggestions. PTAL. |
/gcbrun |
/gcbrun |
/gcbrun |
🤖 I have created a release *beep* *boop* --- <details><summary>2.60.0</summary> ## [2.60.0](v2.59.2...v2.60.0) (2025-06-23) ### Features * handle auto pagination for BigQuery v2 ([#3829](#3829)) ([025c84c](025c84c)) ### Dependencies * update google auth library dependencies to v1.37.1 ([#3846](#3846)) ([ea1d9e5](ea1d9e5)) * update google http client dependencies to v1.47.1 ([#3848](#3848)) ([a9a39d7](a9a39d7)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Thank you for opening a Pull Request! Before submitting your PR, please read our contributing guidelines.
There are a few things you can do to make sure it goes smoothly:
Fixes # b/360114900 & b/352331075