Skip to content

Commit 4b0f5af

Browse files
authored
fix: correct airflow workflow for BYO estimators. (#1052)
The airflow workflow for BYO estimators has been broken since a fix made on 09/13/2019. This resolves that issue. Tests to ensure this does not happen again will be added as part of the next airflow commit that prepares training jobs as part of defining training configuration.
1 parent 0c6c6ff commit 4b0f5af

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/sagemaker/estimator.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ def model_data(self):
561561
)["ModelArtifacts"]["S3ModelArtifacts"]
562562
else:
563563
logging.warning(
564-
"No finished training job found associated with this estimator. Please make sure"
564+
"No finished training job found associated with this estimator. Please make sure "
565565
"this estimator is only used for building workflow config"
566566
)
567567
model_uri = os.path.join(
@@ -718,21 +718,20 @@ def transformer(
718718

719719
if self.latest_training_job is None:
720720
logging.warning(
721-
"No finished training job found associated with this estimator. Please make sure"
721+
"No finished training job found associated with this estimator. Please make sure "
722722
"this estimator is only used for building workflow config"
723723
)
724724
model_name = self._current_job_name
725725
else:
726726
model_name = self.latest_training_job.name
727+
model = self.create_model(vpc_config_override=vpc_config_override)
727728

728-
model = self.create_model(vpc_config_override=vpc_config_override)
729+
# not all create_model() implementations have the same kwargs
730+
model.name = model_name
731+
if role is not None:
732+
model.role = role
729733

730-
# not all create_model() implementations have the same kwargs
731-
model.name = model_name
732-
if role is not None:
733-
model.role = role
734-
735-
model._create_sagemaker_model(instance_type, tags=tags)
734+
model._create_sagemaker_model(instance_type, tags=tags)
736735

737736
return Transformer(
738737
model_name,
@@ -1716,7 +1715,7 @@ def transformer(
17161715
transform_env.update(env)
17171716
else:
17181717
logging.warning(
1719-
"No finished training job found associated with this estimator. Please make sure"
1718+
"No finished training job found associated with this estimator. Please make sure "
17201719
"this estimator is only used for building workflow config"
17211720
)
17221721
model_name = self._current_job_name

0 commit comments

Comments
 (0)