Open ashmeet-kandhari opened 1 week ago
Thanks for reaching out. Here is the Boto3 documentation on pagination for reference: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/paginators.html
It sounds like the behavior you're expecting applies to PageSize
, which controls the number of items returned per page of each result. But PageSize
is not supported for the ListBuildsForProject paginator.
Regarding this:
For example if MaxItems is configured as 20 the response_iterator returns only 20 items then fetches next 100 items and returns first 20 again
With this code I only get 20 items, so MaxItems
is behaving as expected:
import boto3
codebuild = boto3.client('codebuild')
paginator = codebuild.get_paginator('list_builds_for_project')
response_iterator = paginator.paginate(
projectName='test-project',
sortOrder='DESCENDING',
PaginationConfig={
'MaxItems': 20,
}
)
for page in response_iterator:
i = 1
for build_id in page['ids']:
print(f"{i}build_id")
i += 1
If you're seeing different results then please share your debug logs (with any sensitive info redacted) by adding boto3.set_stream_logger('')
to your script.
Describe the bug
When using
paginator
api forcodebuild's list_builds_for_project
api the response still fetches the default size which is 100 items but the iterator gives onlyMaxItems
configured and misses the rest of themFor example if
MaxItems
is configured as 20 theresponse_iterator
returns only 20 items then fetches next 100 items and returns first 20 againRegression Issue
Expected Behavior
Maxitems should fetch only 20 items and then iterate to fetch next 20
Current Behavior
MaxItems only iterates over the configured value from the fetched list and misses the rest of them when it iterates again
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.35.49
Environment details (OS name and version, etc.)
Mac