Skip to content

Commit 7e80849

Browse files
Merge branch 'dev' into tioga_failstep
2 parents 8a325cb + 90b0b0f commit 7e80849

File tree

9 files changed

+174
-87
lines changed

9 files changed

+174
-87
lines changed

doc/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import pkg_resources
1717
from datetime import datetime
1818

19-
project = u"sagemaker"
19+
project = "sagemaker"
2020
version = pkg_resources.require(project)[0].version
2121

2222
# Add any Sphinx extension module names here, as strings. They can be extensions
@@ -38,7 +38,7 @@
3838
source_suffix = ".rst" # The suffix of source filenames.
3939
master_doc = "index" # The master toctree document.
4040

41-
copyright = u"%s, Amazon" % datetime.now().year
41+
copyright = "%s, Amazon" % datetime.now().year
4242

4343
# The full version, including alpha/beta/rc tags.
4444
release = version

src/sagemaker/analytics.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,11 @@ def training_job_summaries(self, force_refresh=False):
261261
)
262262
new_output = raw_result["TrainingJobSummaries"]
263263
output.extend(new_output)
264-
logger.debug("Got %d more TrainingJobs. Total so far: %d", len(new_output), len(output))
264+
logger.debug(
265+
"Got %d more TrainingJobs. Total so far: %d",
266+
len(new_output),
267+
len(output),
268+
)
265269
if ("NextToken" in raw_result) and (len(new_output) > 0):
266270
next_args["NextToken"] = raw_result["NextToken"]
267271
else:
@@ -344,7 +348,7 @@ def _determine_timeinterval(self):
344348
a dict with the `start_time` and `end_time`.
345349
"""
346350
description = self._sage_client.describe_training_job(TrainingJobName=self.name)
347-
start_time = self._start_time or description[u"TrainingStartTime"] # datetime object
351+
start_time = self._start_time or description["TrainingStartTime"] # datetime object
348352
# Incrementing end time by 1 min since CloudWatch drops seconds before finding the logs.
349353
# This results in logs being searched in the time range in which the correct log line was
350354
# not present.
@@ -353,7 +357,7 @@ def _determine_timeinterval(self):
353357
# CW will consider end time as 2018-10-22 08:25 and will not be able to search the
354358
# correct log.
355359
end_time = self._end_time or description.get(
356-
u"TrainingEndTime", datetime.datetime.utcnow()
360+
"TrainingEndTime", datetime.datetime.utcnow()
357361
) + datetime.timedelta(minutes=1)
358362

359363
return {"start_time": start_time, "end_time": end_time}

src/sagemaker/utils.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def name_from_base(base, max_length=63, short=False):
7979

8080
def unique_name_from_base(base, max_length=63):
8181
"""Placeholder Docstring"""
82-
unique = "%04x" % random.randrange(16 ** 4) # 4-digit hex
82+
unique = "%04x" % random.randrange(16**4) # 4-digit hex
8383
ts = str(int(time.time()))
8484
available_length = max_length - 2 - len(ts) - len(unique)
8585
trimmed = base[:available_length]
@@ -413,7 +413,12 @@ def repack_model(
413413
model_dir = _extract_model(model_uri, sagemaker_session, tmp)
414414

415415
_create_or_update_code_dir(
416-
model_dir, inference_script, source_directory, dependencies, sagemaker_session, tmp
416+
model_dir,
417+
inference_script,
418+
source_directory,
419+
dependencies,
420+
sagemaker_session,
421+
tmp,
417422
)
418423

419424
tmp_model_path = os.path.join(tmp, "temp-model.tar.gz")
@@ -544,7 +549,11 @@ def sts_regional_endpoint(region):
544549
return "https://{}".format(endpoint_data["hostname"])
545550

546551

547-
def retries(max_retry_count, exception_message_prefix, seconds_to_sleep=DEFAULT_SLEEP_TIME_SECONDS):
552+
def retries(
553+
max_retry_count,
554+
exception_message_prefix,
555+
seconds_to_sleep=DEFAULT_SLEEP_TIME_SECONDS,
556+
):
548557
"""Retries until max retry count is reached.
549558
550559
Args:

tests/data/multimodel/container/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN apt-get update && \
1515
curl \
1616
vim \
1717
&& rm -rf /var/lib/apt/lists/* \
18-
&& curl -O https://bootstrap.pypa.io/get-pip.py \
18+
&& curl -O https://bootstrap.pypa.io/pip/3.6/get-pip.py \
1919
&& python3 get-pip.py
2020

2121
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

tests/integ/sagemaker/lineage/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def retry(callable, num_attempts=8):
4242
if i == num_attempts - 1:
4343
raise ex
4444
print("Retrying", ex)
45-
time.sleep(2 ** i)
45+
time.sleep(2**i)
4646
assert False, "logic error in retry"
4747

4848

0 commit comments

Comments
 (0)