Skip to content
Merged
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
4 changes: 3 additions & 1 deletion awswrangler/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ def parse_path(path: str) -> Tuple[str, str]:
>>> from awswrangler._utils import parse_path
>>> bucket, key = parse_path('s3://bucket/key')

>>> from awswrangler._utils import parse_path
>>> bucket, key = parse_path('s3://arn:aws:s3:<awsregion>:<awsaccount>:accesspoint/<ap_name>/<key>')
"""
if path.startswith("s3://") is False:
raise exceptions.InvalidArgumentValue(f"'{path}' is not a valid path. It MUST start with 's3://'")
parts = path.replace("s3://", "").split("/", 1)
parts = path.replace("s3://", "").replace(":accesspoint/", ":accesspoint:").split("/", 1)
bucket: str = parts[0]
if "/" in bucket:
raise exceptions.InvalidArgumentValue(f"'{bucket}' is not a valid bucket name.")
Expand Down