@@ -63,12 +63,16 @@ class Step(Entity):
6363
6464 Attributes:
6565 name (str): The name of the step.
66+ display_name (str): The display name of the step.
67+ description (str): The description of the step.
6668 step_type (StepTypeEnum): The type of the step.
6769 depends_on (List[str] or List[Step]): The list of step names or step
6870 instances the current step depends on
6971 """
7072
7173 name : str = attr .ib (factory = str )
74+ display_name : str = attr .ib (default = None )
75+ description : str = attr .ib (default = None )
7276 step_type : StepTypeEnum = attr .ib (factory = StepTypeEnum .factory )
7377 depends_on : Union [List [str ], List ["Step" ]] = attr .ib (default = None )
7478
@@ -91,7 +95,10 @@ def to_request(self) -> RequestType:
9195 }
9296 if self .depends_on :
9397 request_dict ["DependsOn" ] = self ._resolve_depends_on (self .depends_on )
94-
98+ if self .display_name :
99+ request_dict ["DisplayName" ] = self .display_name
100+ if self .description :
101+ request_dict ["Description" ] = self .description
95102 return request_dict
96103
97104 def add_depends_on (self , step_names : Union [List [str ], List ["Step" ]]):
@@ -168,6 +175,8 @@ def __init__(
168175 self ,
169176 name : str ,
170177 estimator : EstimatorBase ,
178+ display_name : str = None ,
179+ description : str = None ,
171180 inputs : Union [TrainingInput , dict , str , FileSystemInput ] = None ,
172181 cache_config : CacheConfig = None ,
173182 depends_on : Union [List [str ], List [Step ]] = None ,
@@ -180,6 +189,8 @@ def __init__(
180189 Args:
181190 name (str): The name of the training step.
182191 estimator (EstimatorBase): A `sagemaker.estimator.EstimatorBase` instance.
192+ display_name (str): The display name of the training step.
193+ description (str): The description of the training step.
183194 inputs (Union[str, dict, TrainingInput, FileSystemInput]): Information
184195 about the training data. This can be one of three types:
185196
@@ -200,7 +211,9 @@ def __init__(
200211 depends_on (List[str] or List[Step]): A list of step names or step instances
201212 this `sagemaker.workflow.steps.TrainingStep` depends on
202213 """
203- super (TrainingStep , self ).__init__ (name , StepTypeEnum .TRAINING , depends_on )
214+ super (TrainingStep , self ).__init__ (
215+ name , display_name , description , StepTypeEnum .TRAINING , depends_on
216+ )
204217 self .estimator = estimator
205218 self .inputs = inputs
206219 self ._properties = Properties (
@@ -248,6 +261,8 @@ def __init__(
248261 model : Model ,
249262 inputs : CreateModelInput ,
250263 depends_on : Union [List [str ], List [Step ]] = None ,
264+ display_name : str = None ,
265+ description : str = None ,
251266 ):
252267 """Construct a CreateModelStep, given an `sagemaker.model.Model` instance.
253268
@@ -261,8 +276,12 @@ def __init__(
261276 Defaults to `None`.
262277 depends_on (List[str] or List[Step]): A list of step names or step instances
263278 this `sagemaker.workflow.steps.CreateModelStep` depends on
279+ display_name (str): The display name of the CreateModel step.
280+ description (str): The description of the CreateModel step.
264281 """
265- super (CreateModelStep , self ).__init__ (name , StepTypeEnum .CREATE_MODEL , depends_on )
282+ super (CreateModelStep , self ).__init__ (
283+ name , display_name , description , StepTypeEnum .CREATE_MODEL , depends_on
284+ )
266285 self .model = model
267286 self .inputs = inputs or CreateModelInput ()
268287
@@ -304,6 +323,8 @@ def __init__(
304323 name : str ,
305324 transformer : Transformer ,
306325 inputs : TransformInput ,
326+ display_name : str = None ,
327+ description : str = None ,
307328 cache_config : CacheConfig = None ,
308329 depends_on : Union [List [str ], List [Step ]] = None ,
309330 ):
@@ -317,10 +338,14 @@ def __init__(
317338 transformer (Transformer): A `sagemaker.transformer.Transformer` instance.
318339 inputs (TransformInput): A `sagemaker.inputs.TransformInput` instance.
319340 cache_config (CacheConfig): A `sagemaker.workflow.steps.CacheConfig` instance.
320- depends_on (List[str] or List[Step]): A list of step names or step instances
321- this `sagemaker.workflow.steps.TransformStep` depends on
341+ display_name (str): The display name of the transform step.
342+ description (str): The description of the transform step.
343+ depends_on (List[str]): A list of step names this `sagemaker.workflow.steps.TransformStep`
344+ depends on
322345 """
323- super (TransformStep , self ).__init__ (name , StepTypeEnum .TRANSFORM , depends_on )
346+ super (TransformStep , self ).__init__ (
347+ name , display_name , description , StepTypeEnum .TRANSFORM , depends_on
348+ )
324349 self .transformer = transformer
325350 self .inputs = inputs
326351 self .cache_config = cache_config
@@ -375,6 +400,8 @@ def __init__(
375400 self ,
376401 name : str ,
377402 processor : Processor ,
403+ display_name : str = None ,
404+ description : str = None ,
378405 inputs : List [ProcessingInput ] = None ,
379406 outputs : List [ProcessingOutput ] = None ,
380407 job_arguments : List [str ] = None ,
@@ -391,6 +418,8 @@ def __init__(
391418 Args:
392419 name (str): The name of the processing step.
393420 processor (Processor): A `sagemaker.processing.Processor` instance.
421+ display_name (str): The display name of the processing step.
422+ description (str): The description of the processing step.
394423 inputs (List[ProcessingInput]): A list of `sagemaker.processing.ProcessorInput`
395424 instances. Defaults to `None`.
396425 outputs (List[ProcessingOutput]): A list of `sagemaker.processing.ProcessorOutput`
@@ -405,7 +434,9 @@ def __init__(
405434 depends_on (List[str] or List[Step]): A list of step names or step instance
406435 this `sagemaker.workflow.steps.ProcessingStep` depends on
407436 """
408- super (ProcessingStep , self ).__init__ (name , StepTypeEnum .PROCESSING , depends_on )
437+ super (ProcessingStep , self ).__init__ (
438+ name , display_name , description , StepTypeEnum .PROCESSING , depends_on
439+ )
409440 self .processor = processor
410441 self .inputs = inputs
411442 self .outputs = outputs
@@ -468,6 +499,8 @@ def __init__(
468499 self ,
469500 name : str ,
470501 tuner : HyperparameterTuner ,
502+ display_name : str = None ,
503+ description : str = None ,
471504 inputs = None ,
472505 job_arguments : List [str ] = None ,
473506 cache_config : CacheConfig = None ,
@@ -481,6 +514,8 @@ def __init__(
481514 Args:
482515 name (str): The name of the tuning step.
483516 tuner (HyperparameterTuner): A `sagemaker.tuner.HyperparameterTuner` instance.
517+ display_name (str): The display name of the tuning step.
518+ description (str): The description of the tuning step.
484519 inputs: Information about the training data. Please refer to the
485520 ``fit()`` method of the associated estimator, as this can take
486521 any of the following forms:
@@ -514,7 +549,9 @@ def __init__(
514549 depends_on (List[str] or List[Step]): A list of step names or step instance
515550 this `sagemaker.workflow.steps.ProcessingStep` depends on
516551 """
517- super (TuningStep , self ).__init__ (name , StepTypeEnum .TUNING , depends_on )
552+ super (TuningStep , self ).__init__ (
553+ name , display_name , description , StepTypeEnum .TUNING , depends_on
554+ )
518555 self .tuner = tuner
519556 self .inputs = inputs
520557 self .job_arguments = job_arguments
0 commit comments