Skip to content

[Python] Add support for the SSO credential provider #29912

Closed

Description

@asfimport

Not sure about other languages
see also: boto/botocore#2070

from pyarrow.fs import S3FileSystem 

bucket = 'some-bucket-with-read-access' 
key = 'some-existing-key' 

s3 = S3FileSystem() 
s3.open_input_file(f'{bucket}/{key}')

 
results in

 

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    s3.open_input_file(f'{bucket}/{key}')
  File "pyarrow/_fs.pyx", line 587, in pyarrow._fs.FileSystem.open_input_file
  File "pyarrow/error.pxi", line 143, in pyarrow.lib.pyarrow_internal_check_status
  File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: When reading information for key 'some-existing-key' in bucket 'some-bucket-with-read-access': AWS Error [code 15]: No response body.

 

without sso creds supported - shouldn't it raise some kind of AccessDenied Exception?

 

 

Reporter: Björn Boschman

Related issues:

Note: This issue was originally created as ARROW-14342. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Oct 5, 2022

    @asfimport
    Author

    Will Jones / @wjones127:
    SSO support was added in aws-sdk-cpp 1.9. Once we upgrade that dependency we should automatically get support for this.

    aws/aws-sdk-cpp#1433 (comment)

  2. asfimport commented on Oct 5, 2022

    @asfimport
    Author

    Will Jones / @wjones127:
    In the meantime, you can work around this by using boto3 to resolve the SSO credentials:

    from boto3 import Session
    
    session = Session()
    credentials = session.get_credentials()
    s3 = S3FileSystem(
        access_key=current_credentials.access_key,
        secret_key=current_credentials.secret_key,
        session_token=current_credentials.token,
    )
  3. added this to the 11.0.0 milestone on Jan 11, 2023
  4. removed this from the 11.0.0 milestone on Jan 11, 2023
  5. AQX-Ben commented on Feb 8, 2023

    @AQX-Ben

    Any updates on this issue ?

    geopandas uses Pyarrow to read geo parquet.
    It is not possible to use the workaround from @asfimport.

  6. westonpace commented on Feb 9, 2023

    @westonpace
    Member

    AFAIK we are still on 1.8 of AWS SDK. Someone will have to try bumping the AWS SDK version and see how it goes. @wjones127 do you know if there is any plan to bump the AWS version?

  7. wjones127 commented on Feb 9, 2023

    @wjones127
    Member

    @AQX-Ben Why is it not possible to use the workaround? You should be able to pass the filesystem to geopandas.read_parquet or pass storage options with the key.

    https://geopandas.org/en/stable/docs/reference/api/geopandas.read_parquet.html#geopandas.read_parquet

    @westonpace not sure but I can look at bumping that for the next version, at least for Python.

  8. kou commented on Feb 9, 2023

    @kou
    Member
  9. wjones127 commented on Mar 6, 2023

    @wjones127
    Member

    I just tested with the main branch. AWS SSO will work in the 12.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions