Skip to content

Commit 5b66f4c

Browse files
authored
Apply suggestions from code review
1 parent 16d8fa7 commit 5b66f4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/clp-py-utils/clp_py_utils/s3_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@ def parse_s3_url(s3_url: str) -> Tuple[str, str, str]:
205205
"""
206206

207207
host_style_url_regex = re.compile(
208-
r"https://(?P<bucket_name>[a-z0-9.-]+)\.s3(\.(?P<region_code>[a-z]+-[a-z]+-[0-9]))?"
208+
r"https://(?P<bucket_name>[a-z0-9.-]+)\.s3(\.(?P<region_code>[a-z]+-[a-z]+-[0-9]))"
209209
r"\.(?P<endpoint>[a-z0-9.-]+)/(?P<key_prefix>[^?]+).*"
210210
)
211211
match = host_style_url_regex.match(s3_url)
212212

213213
if match is None:
214214
path_style_url_regex = re.compile(
215-
r"https://s3(\.(?P<region_code>[a-z]+-[a-z]+-[0-9]))?\.(?P<endpoint>[a-z0-9.-]+)/"
215+
r"https://s3(\.(?P<region_code>[a-z]+-[a-z]+-[0-9]))\.(?P<endpoint>[a-z0-9.-]+)/"
216216
r"(?P<bucket_name>[a-z0-9.-]+)/(?P<key_prefix>[^?]+).*"
217217
)
218218
match = path_style_url_regex.match(s3_url)

0 commit comments

Comments
 (0)