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

feat(python): Automatically use boto3 / google-auth if installed when scanning cloud #19677

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Nov 7, 2024

For AWS, boto3 adds:

  • Auto detection and usage of AWS_PROFILE environment variable
  • Additionally also parses the aws_session_token from ~/.aws/credentials

This fixes scanning from our internal S3 cloud after the authentication process changes:

>>> pl.scan_parquet(POLARS_S3_PREFIX + "iris.parquet", credential_provider=None).collect()
polars.exceptions.ComputeError: Generic S3 error: Client error with status 403 Forbidden: No Body
>>> pl.scan_parquet(POLARS_S3_PREFIX + "iris.parquet", credential_provider="auto").collect()
shape: (150, 5)
┌──────────────┬─────────────┬──────────────┬─────────────┬───────────┐
│ sepal_lengthsepal_widthpetal_lengthpetal_widthspecies   │
...

We currently error because our rust config builder isn't parsing the aws_session_token from ~/.aws/credentials.

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Nov 7, 2024
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.74%. Comparing base (4b03406) to head (6161097).
Report is 20 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19677   +/-   ##
=======================================
  Coverage   79.73%   79.74%           
=======================================
  Files        1541     1541           
  Lines      212227   212227           
  Branches     2449     2449           
=======================================
+ Hits       169226   169238   +12     
+ Misses      42446    42435   -11     
+ Partials      555      554    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit d32cf0a into pola-rs:main Nov 7, 2024
13 checks passed
tylerriccio33 pushed a commit to tylerriccio33/polars that referenced this pull request Nov 8, 2024
@c-peters c-peters added the accepted Ready for implementation label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants