Skip to content

Commit 934c312

Browse files
author
Shikha Panghal
committed
running black-format
1 parent 6926ff8 commit 934c312

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/sagemaker/estimator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,9 @@ def _prepare_init_params_from_job_description(cls, job_details, model_channel_na
11251125
init_params["max_wait"] = max_wait
11261126

11271127
if job_details.get("RetryStrategy", False):
1128-
init_params["max_retry_attempts"] = job_details.get("RetryStrategy", {})\
1129-
.get("MaximumRetryAttempts")
1128+
init_params["max_retry_attempts"] = job_details.get("RetryStrategy", {}).get(
1129+
"MaximumRetryAttempts"
1130+
)
11301131
max_wait = job_details.get("StoppingCondition", {}).get("MaxWaitTimeInSeconds")
11311132
if max_wait:
11321133
init_params["max_wait"] = max_wait

tests/integ/test_tf.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ def test_mnist_with_checkpoint_config(
9595
expected_retry_strategy = {
9696
"MaximumRetryAttempts": 2,
9797
}
98-
actual_retry_strategy = (
99-
sagemaker_session.sagemaker_client.describe_training_job(TrainingJobName=training_job_name)[
100-
"RetryStrategy"
101-
]
102-
)
98+
actual_retry_strategy = sagemaker_session.sagemaker_client.describe_training_job(
99+
TrainingJobName=training_job_name
100+
)["RetryStrategy"]
103101
assert actual_training_checkpoint_config == expected_training_checkpoint_config
104102
assert actual_training_environment_variable_config == ENV_INPUT
105103
assert actual_retry_strategy == expected_retry_strategy

tests/unit/test_estimator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3183,9 +3183,7 @@ def test_prepare_init_params_from_job_description_with_spot_training():
31833183

31843184
def test_prepare_init_params_from_job_description_with_retry_strategy():
31853185
job_description = RETURNED_JOB_DESCRIPTION.copy()
3186-
job_description["RetryStrategy"] = {
3187-
"MaximumRetryAttempts": 2
3188-
}
3186+
job_description["RetryStrategy"] = {"MaximumRetryAttempts": 2}
31893187
job_description["StoppingCondition"] = {
31903188
"MaxRuntimeInSeconds": 86400,
31913189
"MaxWaitTimeInSeconds": 87000,

0 commit comments

Comments
 (0)