Skip to content

Commit 34a99e2

Browse files
author
Sergey Ermolin
committed
#using uuid to randomize, otherwise system timestamp is used
1 parent c96516c commit 34a99e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/sagemaker/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
from sagemaker import deprecations
3434
from sagemaker.session_settings import SessionSettings
3535

36+
import uuid
37+
3638

3739
ECR_URI_PATTERN = r"^(\d+)(\.)dkr(\.)ecr(\.)(.+)(\.)(.*)(/)(.*:.*)$"
3840
MAX_BUCKET_PATHS_COUNT = 5
@@ -81,6 +83,7 @@ def name_from_base(base, max_length=63, short=False):
8183

8284
def unique_name_from_base(base, max_length=63):
8385
"""Placeholder Docstring"""
86+
random.seed(int(uuid.uuid4())) #using uuid to randomize, otherwise system timestamp is used.
8487
unique = "%04x" % random.randrange(16**4) # 4-digit hex
8588
ts = str(int(time.time()))
8689
available_length = max_length - 2 - len(ts) - len(unique)

0 commit comments

Comments
 (0)