-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable use of page_size for clients #408
Conversation
@@ -12,6 +12,7 @@ | |||
# language governing permissions and limitations under the License. | |||
|
|||
from tests import unittest | |||
from botocore.paginate import Paginator as FuturePaginator |
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.
Since the Paginator
name is clobbered by the renaming of DeprecatedPaginator
, I had to rename the paginator that we will eventually be using. I considered switching everything over to the paginator will be using in the future. However the CLI relies on the deprecated paginators, so I was hesitant to make the switch.
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.
Might be nice to add this as a comment in the test so we don't forget why this was done.
Looks good. On a completely separate note, I'm finding it jarring that we use CamelCased and snake_cased params for pagination. I'm thinking for the client we should be consistent and use the CamelCased params for the pagination values as well. Thoughts? cc @danielgtaylor |
LGTM 🚢-it. CamelCased or snake_cased are both fine for me. It seems possible that some service in the future might not use CamelCasing for its args, and then we'll have the opposite problem we do today. If we want to go with CamelCasing for now then that's fine since (all?) services use CamelCased params. |
I don't think a service will ever use snake_casing. |
+1 CamelCase since we are moving away from service and operation objects, which accept snake_case. |
I added a todo comment to help us later on when we switched the test to use the non deprecated paginator. Merging. |
Enable use of page_size for clients
So the reason I made this pull request is because, you cannot paginate using a page size with clients. This is what the error you get before my PR:
This also probably affects boto3 since it uses clients to paginate as well.
The fix was to retrieve the
limit_key
from the pagination config instead of relying on an Operation object for thelimit_key
, which the clients had no access to.cc @jamesls @danielgtaylor