Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fixes bug where MinIOCredentials are not correctly resolved when used with S3Bucket #254

Merged
merged 2 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed bug where incorrect credentials model was selected when `MinIOCredentials` was used with `S3Bucket` - [#254](https://github.com/PrefectHQ/prefect-aws/pull/254)

### 0.3.1

Released on April 20th, 2023.
Expand Down
3 changes: 3 additions & 0 deletions prefect_aws/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ class S3Bucket(WritableFileSystem, WritableDeploymentStorage, ObjectStorageBlock
),
)

class Config:
smart_union = True

# Property to maintain compatibility with storage block based deployments
@property
def basepath(self) -> str:
Expand Down
4 changes: 4 additions & 0 deletions tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ def s3_bucket_with_objects(self, s3_bucket_with_object, object_in_folder):
)
return _s3_bucket_with_objects

def test_credentials_are_correct_type(self, credentials):
s3_bucket = S3Bucket(bucket_name="bucket", credentials=credentials)
assert isinstance(s3_bucket.credentials, type(credentials))

@pytest.mark.parametrize("client_parameters", aws_clients[-1:], indirect=True)
def test_list_objects_empty(self, s3_bucket_empty, client_parameters):
assert s3_bucket_empty.list_objects() == []
Expand Down