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

Commit 6b2ce3b

Browse files
authored
Stop resolve_path defaulting to random UUID if path is "" (#212)
1 parent 7a17997 commit 6b2ce3b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
### Fixed
1919

2020
- Fixed errors raised when using `write_path` and `read_path` with `credentials` field on `S3Bucket` - [#208](https://github.com/PrefectHQ/prefect-aws/pull/208)
21+
- Resolving paths in `S3Bucket` unintentionally generating an arbitrary UUID when path is an empty string - [#212](https://github.com/PrefectHQ/prefect-gcp/pull/212)
2122

2223
## 0.2.4
2324

prefect_aws/s3.py

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import warnings
77
from pathlib import Path, PurePath
88
from typing import Any, BinaryIO, Dict, List, Optional, Union
9-
from uuid import uuid4
109

1110
import boto3
1211
from botocore.paginate import PageIterator
@@ -402,9 +401,6 @@ def _resolve_path(self, path: str) -> str:
402401
bucket has a unique key (or key name).
403402
404403
"""
405-
406-
path = path or str(uuid4())
407-
408404
bucket_folder = self.bucket_folder or self.basepath
409405
# If basepath provided, it means we won't write to the root dir of
410406
# the bucket. So we need to add it on the front of the path.

tests/test_s3.py

+4
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ def test_deployment_set_basepath(aws_creds_block, type_):
594594
assert deployment.location == "home/"
595595

596596

597+
def test_resolve_path(s3_bucket):
598+
assert s3_bucket._resolve_path("") == ""
599+
600+
597601
class TestS3Bucket:
598602
@pytest.fixture(
599603
params=[

0 commit comments

Comments
 (0)