-
Notifications
You must be signed in to change notification settings - Fork 426
AWS profile support #2948
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
base: main
Are you sure you want to change the base?
AWS profile support #2948
Conversation
79e50a1 to
be62e94
Compare
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Left a comment about passing profile name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds AWS profile support for the Glue catalog client and fsspec-based S3 FileIO, addressing issue #2841. Users can now explicitly configure AWS profiles through client.profile-name (unified) and s3.profile-name (S3-specific) properties, with s3.profile-name taking precedence over client.profile-name for S3 operations. Similarly, glue.profile-name takes precedence over client.profile-name for Glue catalog operations.
Changes:
- Added
AWS_PROFILE_NAMEandS3_PROFILE_NAMEconfiguration constants - Extended GlueCatalog to support fallback from
glue.profile-nametoclient.profile-name - Implemented profile support in S3FileSystem by creating AioSession with the configured profile
- Added comprehensive unit tests validating profile propagation
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pyiceberg/io/init.py | Defines new constants AWS_PROFILE_NAME and S3_PROFILE_NAME for configuration properties |
| pyiceberg/catalog/glue.py | Updates GlueCatalog to fall back to client.profile-name when glue.profile-name is not set |
| pyiceberg/io/fsspec.py | Implements profile support by creating AioSession with the configured profile for S3FileSystem |
| tests/catalog/test_glue_profile.py | Adds test verifying GlueCatalog uses client.profile-name when provided |
| tests/io/test_fsspec_profile.py | Adds tests verifying S3FileIO uses both s3.profile-name and client.profile-name |
| tests/io/test_fsspec.py | Updates existing tests to include session=None parameter in S3FileSystem assertions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3b4f02e to
97c562a
Compare
97c562a to
5547322
Compare
Closes #2841
Rationale for this change
This PR adds explicit AWS profile support for both the Glue catalog client and
fsspec-based S3 FileIO.
While
GlueCatalogalready supports profile configuration, fsspec-based S3operations did not propagate profile selection to the underlying
S3FileSystemor async AWS session. As a result, users had to rely on environmentvariables or the default AWS profile, which makes it difficult to work with
multiple AWS configurations in parallel.
This change introduces two configuration properties:
client.profile-name: a unified AWS profile for the catalog client and FileIOs3.profile-name: an AWS profile specifically for S3 FileIOProfile resolution follows this precedence:
s3.profile-nameclient.profile-nameThis ensures consistent and explicit credential selection across catalog and
FileIO layers when using the fsspec backend.
Are these changes tested?
Yes. New unit tests were added to validate the profile propagation behavior.
Glue Catalog
boto3.Session(profile_name=...)is created when initializingGlueCatalogwithclient.profile-name.S3 FileIO (fsspec)
client.profile-nameors3.profile-nameresults in thecreation of an async AWS session with the correct profile, which is then
passed to
S3FileSystem.The tests were run locally with:
Output would be:
Are there any user-facing changes?
Yes, this adds new configuration properties that users can set:
client.profile-name: Sets the AWS profile for both the catalog client and FileIO (unified configuration).s3.profile-name: Sets the AWS profile specifically for S3 FileIO.Example Usage: