-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SQS get_paginator for list_queues only returning 1000 items #3406
Comments
Hi @AMMullan thanks for reaching out. I commented on a related issue here a few months ago: #3078 (comment). As mentioned there only 1000 results are returned by default but you can use pagination to iterate through all of the queues. This is noted here in the documentation as well: |
Thanks @tim-finnigan but that's what get_paginator is for...? I've never had to add the PageSize on to get_paginator for any other service to get complete results (i.e. ec2.get_paginator('describe_instances').paginate() returns all instances with no extra params required. |
Hi @AMMullan but in the case of describe_instances do you have over 1000 instances? The MaxResults for that API call is also 1000. This issue you brought up actually came up recently the AWS CLI repository as well: aws/aws-cli#8160. As mentioned there I reached out to the SQS team about increasing the max limit of a request but I have not received a response yet. |
@tim-finnigan - that's a good point, I never have more than 1000 instances. I do have more than 1000 IAM Roles and the get_paginator is required for that and returns them all BUT there is no mention on the doc page for that about a limit. I think I'm just confused by the fact that the paginator needs additional pagination, unless you pass in the PageSize; in which case it work as you'd expect. Am I being simple here and not understanding what the point of get_paginator is? I thought I'd been using it correctly for the last few years but perhaps not :/ |
Hi @AMMullan thanks for following up. In the SQS Developer Guide it notes:
So I think what's happening is that setting I could also confirm the behavior by passing import boto3
# Create a client
client = boto3.client('sqs', region_name='us-west-2')
# Create a reusable Paginator
paginator = client.get_paginator('list_queues')
operation_parameters = {'MaxResults': 1000}
# Create a PageIterator from the Paginator
page_iterator = paginator.paginate(**operation_parameters)
for page in page_iterator:
print(len(page['QueueUrls'])) Each service team owns their pagination models and there are some inconsistencies in how those models are defined. I tried testing the IAM ListRoles paginator for comparison but I'm only able to create up to 1000 roles in my account. |
Thanks @tim-finnigan - at least now I know for future ref to always include the PageSize/MaxResults in my pagination config :) |
Describe the bug
When using the paginator with list_queues I can only get 1000 max results unless I explicily define PageSize - never seen this on any other service and to me, this feels like a bug?
Expected Behavior
Returns complete list of SQS Queues
Current Behavior
Returns 1000
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
SDK version used
boto3/1.23.6 botocore/1.26.6
Environment details (OS name and version, etc.)
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: