-
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
// this is used to determine factors about pagination fields and to allow users to pass a "number" instead of | ||
// having to convert to a protobuf wrapper type to determine page size | ||
const wrappersAllowed = | ||
ENABLE_WRAPPER_TYPES_FOR_PAGE_SIZE[parameters.service.packageName]; |
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 if you don't want pubsub to change, you'd make this:
ENABLE_WRAPPER_TYPES_FOR_PAGE_SIZE[parameters.service.packageName] ? true : undefined
This would preserve current behavior but it would also make it less clear in the future. However, do you envision this list being actually a full dict of opt-in or opt-outs? I could also see ENABLE_WRAPPER_TYPES_FOR_PAGE_SIZE
just being an array where we assume opt-in. I'm fine either way, perhaps it's best to talk to pubsub since it seems they're the only other ones potentially affected by this change (i.e., do they want to explicitly opt-out or just continue functionality?)
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