Skip to content

Commit f58941a

Browse files
committed
fix errors
1 parent 0a8ab6a commit f58941a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/sagemaker/workflow/steps.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class Step(Entity):
6464
Attributes:
6565
name (str): The name of the step.
6666
step_type (StepTypeEnum): The type of the step.
67-
6867
"""
6968

7069
name: str = attr.ib(factory=str)
@@ -133,7 +132,7 @@ def __init__(
133132
name (str): The name of the training step.
134133
estimator (EstimatorBase): A `sagemaker.estimator.EstimatorBase` instance.
135134
inputs (TrainingInput): A `sagemaker.inputs.TrainingInput` instance. Defaults to `None`.
136-
cache_config (CacheConfig): An instance to enable caching.
135+
cache_config (CacheConfig): A `sagemaker.steps.CacheConfig` instance to enable caching.
137136
"""
138137
super(TrainingStep, self).__init__(name, StepTypeEnum.TRAINING)
139138
self.estimator = estimator
@@ -171,7 +170,8 @@ def properties(self):
171170
def to_request(self) -> RequestType:
172171
"""Updates the dictionary with cache configuration."""
173172
request_dict = super().to_request()
174-
request_dict.update(self.cache_config.config)
173+
if self.cache_config:
174+
request_dict.update(self.cache_config.config)
175175

176176
return request_dict
177177

@@ -293,7 +293,8 @@ def properties(self):
293293
def to_request(self) -> RequestType:
294294
"""Updates the dictionary with cache configuration."""
295295
request_dict = super().to_request()
296-
request_dict.update(self.cache_config.config)
296+
if self.cache_config:
297+
request_dict.update(self.cache_config.config)
297298

298299
return request_dict
299300

@@ -378,7 +379,8 @@ def properties(self):
378379
def to_request(self) -> RequestType:
379380
"""Get the request structure for workflow service calls."""
380381
request_dict = super(ProcessingStep, self).to_request()
381-
request_dict.update(self.cache_config.config)
382+
if self.cache_config:
383+
request_dict.update(self.cache_config.config)
382384
if self.property_files:
383385
request_dict["PropertyFiles"] = [
384386
property_file.expr for property_file in self.property_files

0 commit comments

Comments
 (0)