Skip to content

Commit 6f53576

Browse files
author
pialidas
committed
Bug fixes
1 parent 450ceb7 commit 6f53576

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

src/sagemaker/automl/automl.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# %load /home/ec2-user/anaconda3/envs/python3/lib/python3.6/site-packages/sagemaker/automl/automl.py
12
# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License"). You
@@ -123,33 +124,34 @@ def attach(cls, job_name, sagemaker_session=None):
123124
amlj = AutoML(
124125
role=_auto_ml_job_desc["RoleArn"],
125126
target_attribute_name=_auto_ml_job_desc["InputDataConfig"][0]["TargetAttributeName"],
126-
problem_type=_auto_ml_job_desc["ProblemType"],
127-
output_path=_auto_ml_job_desc["OutputDataConfig"]["S3OutputPath"],
128127
output_kms_key=_auto_ml_job_desc["OutputDataConfig"].get("KmsKeyId"),
128+
output_path=_auto_ml_job_desc["OutputDataConfig"]["S3OutputPath"],
129129
base_job_name=job_name,
130+
compression_type=_auto_ml_job_desc["InputDataConfig"][0].get("CompressionType"),
130131
sagemaker_session=sagemaker_session,
131-
volume_kms_key=_auto_ml_job_desc["AutoMLJobConfig"]
132+
volume_kms_key=_auto_ml_job_desc.get("AutoMLJobConfig", {})
132133
.get("SecurityConfig", {})
133134
.get("VolumeKmsKeyId"),
134-
encrypt_inter_container_traffic=_auto_ml_job_desc["AutoMLJobConfig"]
135+
encrypt_inter_container_traffic=_auto_ml_job_desc.get("AutoMLJobConfig", {})
135136
.get("SecurityConfig", {})
136137
.get("EnableInterContainerTrafficEncryption", False),
137-
vpc_config=_auto_ml_job_desc["AutoMLJobConfig"]
138+
vpc_config=_auto_ml_job_desc.get("AutoMLJobConfig", {})
138139
.get("SecurityConfig", {})
139140
.get("VpcConfig"),
140-
max_candidates=_auto_ml_job_desc["AutoMLJobConfig"]["CompletionCriteria"][
141-
"MaxCandidates"
142-
],
143-
max_runtime_per_training_job_in_seconds=_auto_ml_job_desc["AutoMLJobConfig"][
144-
"CompletionCriteria"
145-
]["MaxRuntimePerTrainingJobInSeconds"],
146-
total_job_runtime_in_seconds=_auto_ml_job_desc["AutoMLJobConfig"]["CompletionCriteria"][
147-
"MaxAutoMLJobRuntimeInSeconds"
148-
],
149-
job_objective=_auto_ml_job_desc["AutoMLJobObjective"]["MetricName"],
150-
generate_candidate_definitions_only=_auto_ml_job_desc[
151-
"GenerateCandidateDefinitionsOnly"
152-
],
141+
problem_type=_auto_ml_job_desc.get("ProblemType"),
142+
max_candidates=_auto_ml_job_desc.get("AutoMLJobConfig", {})
143+
.get("CompletionCriteria", {})
144+
.get("MaxCandidates"),
145+
max_runtime_per_training_job_in_seconds=_auto_ml_job_desc.get("AutoMLJobConfig", {})
146+
.get("CompletionCriteria", {})
147+
.get("MaxRuntimePerTrainingJobInSeconds"),
148+
total_job_runtime_in_seconds=_auto_ml_job_desc.get("AutoMLJobConfig", {})
149+
.get("CompletionCriteria", {})
150+
.get("MaxAutoMLJobRuntimeInSeconds"),
151+
job_objective=_auto_ml_job_desc.get("AutoMLJobObjective", {}).get("MetricName"),
152+
generate_candidate_definitions_only=_auto_ml_job_desc.get(
153+
"GenerateCandidateDefinitionsOnly", False
154+
),
153155
tags=automl_job_tags,
154156
)
155157
amlj.current_job_name = job_name

0 commit comments

Comments
 (0)