Skip to content

Conversation

@jurayev
Copy link
Owner

@jurayev jurayev commented Jun 21, 2021

No description provided.

try:
s3 = get_s3_client()
objects = s3.list_objects_v2(Bucket=bucket_name)["Contents"]
objects = s3.list_objects(Bucket=bucket_name)["Contents"]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

This code uses an outdated API. list_objects_v2 is the revised List Objects API, and we recommend you use this revised API for new application developments.

try:
s3 = get_s3_client()
objects = s3.list_objects_v2(Bucket=bucket_name)["Contents"]
objects = s3.list_objects(Bucket=bucket_name)["Contents"]
Copy link
Owner Author

Choose a reason for hiding this comment

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

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

The API method list_objects returns paginated results instead of all results. Consider using the pagination API or checking one of the following keys in the response to verify that all results were returned: IsTruncated, Marker, NextMarker, NextToken.

Learn more

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.

2 participants