Skip to content
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

[V2] Add warning for invalid max-items value #8855

Merged
merged 21 commits into from
Sep 20, 2024
Merged

Conversation

aemous
Copy link
Contributor

@aemous aemous commented Aug 8, 2024

Description of changes:
Explicitly warn users that we do not support non-positive values for the max-items global pagination argument.

Example output:

aws s3api list-objects --bucket bucket-123 --max-items 0
2024-08-08 12:11:58,993 - awscli.customizations.paginate - CRITICAL - Non-positive values for --max-items are unsupported and may yield undefined behavior.

{
    "RequestCharged": null
} 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@hssyoo hssyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good start! You've got the right idea, I just had a couple suggestions on where to do the validation.

awscli/customizations/paginate.py Outdated Show resolved Hide resolved
awscli/customizations/paginate.py Outdated Show resolved Hide resolved
kdaily
kdaily previously requested changes Sep 4, 2024
tests/integration/test_smoke.py Outdated Show resolved Hide resolved
tests/unit/customizations/test_paginate.py Show resolved Hide resolved
.changes/next-release/enhancement-paginator-41862.json Outdated Show resolved Hide resolved
awscli/customizations/paginate.py Outdated Show resolved Hide resolved
tests/unit/customizations/test_paginate.py Outdated Show resolved Hide resolved
@aemous
Copy link
Contributor Author

aemous commented Sep 18, 2024

Iterated on all requested feedback. If this looks good I'll open a V1 version with the same code. @hssyoo

tests/unit/customizations/test_paginate.py Outdated Show resolved Hide resolved
awscli/customizations/paginate.py Outdated Show resolved Hide resolved
@aemous
Copy link
Contributor Author

aemous commented Sep 18, 2024

Iterated on all requested feedback. If this looks good I'll open a V1 version with the same code. @hssyoo

@aemous aemous dismissed kdaily’s stale review September 20, 2024 16:36

changes requested and resolved; approval received otherwise

@aemous aemous merged commit 5114834 into aws:v2 Sep 20, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants