Skip to content

Commit 863a883

Browse files
authored
Add support for S3 Access Points (#393) (#491)
1 parent 6172b4c commit 863a883

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

awswrangler/_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ def parse_path(path: str) -> Tuple[str, str]:
124124
>>> from awswrangler._utils import parse_path
125125
>>> bucket, key = parse_path('s3://bucket/key')
126126
127+
>>> from awswrangler._utils import parse_path
128+
>>> bucket, key = parse_path('s3://arn:aws:s3:<awsregion>:<awsaccount>:accesspoint/<ap_name>/<key>')
127129
"""
128130
if path.startswith("s3://") is False:
129131
raise exceptions.InvalidArgumentValue(f"'{path}' is not a valid path. It MUST start with 's3://'")
130-
parts = path.replace("s3://", "").split("/", 1)
132+
parts = path.replace("s3://", "").replace(":accesspoint/", ":accesspoint:").split("/", 1)
131133
bucket: str = parts[0]
132134
if "/" in bucket:
133135
raise exceptions.InvalidArgumentValue(f"'{bucket}' is not a valid bucket name.")

0 commit comments

Comments
 (0)