Skip to content

Update the S3 client initialization to explicitly use boto3.Session() #461

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

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Update the S3 client initialization to explicitly use boto3.Session() #461

merged 4 commits into from
Feb 6, 2025

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Feb 4, 2025

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

This PR updates the S3 client initialization to explicitly use boto3.Session(), ensuring proper credential refresh, especially when using temporary AWS credentials. This prevents potential ExpiredToken errors when credentials expire.

Fixes #458.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78%. Comparing base (a147df6) to head (8b8588f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #461   +/-   ##
===================================
- Coverage    78%    78%   -0%     
===================================
  Files        37     37           
  Lines      5365   5367    +2     
===================================
+ Hits       4182   4183    +1     
- Misses     1183   1184    +1     

@tchaton tchaton marked this pull request as ready for review February 5, 2025 13:57
@bhimrazy bhimrazy changed the title [WIP]: Update the S3 client initialization to explicitly use boto3.Session() Update the S3 client initialization to explicitly use boto3.Session() Feb 6, 2025
@Borda Borda merged commit 452cb40 into Lightning-AI:main Feb 6, 2025
29 checks passed
@bhimrazy bhimrazy deleted the fix/aws-s3-client branch February 6, 2025 08:52
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.

s3 client expire after 1 hour: an error occurred (400) when calling the headobject operation: bad request" due to download_chunk_from_index(chunk_index)
3 participants