Skip to content

Commit c424bce

Browse files
author
Sergey Ermolin
authored
#using uuid to randomize, otherwise system timestamp is used (#3046)
* #using uuid to randomize, otherwise system timestamp is used
1 parent 6fb0a99 commit c424bce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sagemaker/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import time
2626
import json
2727
import abc
28+
import uuid
2829
from datetime import datetime
2930

3031
import botocore
@@ -81,6 +82,7 @@ def name_from_base(base, max_length=63, short=False):
8182

8283
def unique_name_from_base(base, max_length=63):
8384
"""Placeholder Docstring"""
85+
random.seed(int(uuid.uuid4())) # using uuid to randomize, otherwise system timestamp is used.
8486
unique = "%04x" % random.randrange(16**4) # 4-digit hex
8587
ts = str(int(time.time()))
8688
available_length = max_length - 2 - len(ts) - len(unique)

0 commit comments

Comments
 (0)