-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: paging changes for bigquery #1661
base: main
Are you sure you want to change the base?
Conversation
8c5dd23
to
55da34f
Compare
Edit - adding the original questions because I (leahecole/coleleah) deleted them from the description:
Ok great! Answering a few questions/comments:
|
Noted! Re point 3 I think that I redid the baselines before I took out a comment I had in a nunjucks file and so that makes sense why it hit so many. I will work on a few outstanding changes, make those baselines, and get this ready for real review |
I added baselines @sofisl! I am honestly not sure why the pubsub baseline regenerates. However, it regenerated with the correct behavior - that maxResultsParameter is set to false because pubsub isn't an allowlisted service, so I am less concerned than if it regenerated with maxResultsParameter set to true. |
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 we'll also want to add cjs+ esm tests here and make sure they pass
@googleapis/jsteam-handwritten-libraries FYI, this is part of some modernization work being done for BQ - if your library is also impacted by this, feel free to ping me and I can share more |
…r-typescript into paging_changes
@@ -893,10 +894,23 @@ export class {{ service.name }}Client { | |||
{{ util.toInterface(method.outputInterface) }} | |||
]>|void { | |||
request = request || {}; | |||
{%- if method.maxResultsParameter %} | |||
// the underlying API expects a UInt32Value or Int32Value object |
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 would actually get rid of this comment or perhaps reword it, as technically this is what goes in the client library (and thus what users actually use). Maybe just say:
Converts number to Unit32 or Int32 value for non-compliant APIs.
// services that are allowed to use Int32Value and UInt32Value protobuf wrapper types | ||
// instead of "number" for pageSize/maxResults | ||
// keyed by proto package name, e.g. "google.cloud.foo.v1". | ||
const ENABLE_WRAPPER_TYPES_FOR_PAGE_SIZE = { |
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.
nit, this could be simplified if we just assume this list is opt-in, and remove the true
flag, but up to you!
This PR resolves b/360115234 - see that bug and its parent b/352331075 for initial proposal info. Things this PR does include:
MethodDescriptorProto
interface calledmaxResultsParameter
- this is true if integer wrapper types are allowed and a method has amaxResults
parametermaxResultsParameter
set to true, if it is a paginated method (but not async or stream), convert anumber
type that the user passes in and reformat it to be in the proper wrapped integer type the underlying API expectsmaxResultsParameter
set to true, if it is a paginated method (but not an async or stream one), and if the parameter ismaxResults
, update the param comments, allow either the wrapper type or thenumber
type-logic in the samples templates that when a method has
maxResultsParameter
set to true, if it is a paginated method (but not an async or stream one), and if the parameter ismaxResults
, update the TODO comments to have the example comment be a number type instead of the protobuf onecc @shollyman @alvarowolfx