@@ -63,12 +63,16 @@ class Step(Entity):
63
63
64
64
Attributes:
65
65
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.
66
68
step_type (StepTypeEnum): The type of the step.
67
69
depends_on (List[str] or List[Step]): The list of step names or step
68
70
instances the current step depends on
69
71
"""
70
72
71
73
name : str = attr .ib (factory = str )
74
+ display_name : str = attr .ib (default = None )
75
+ description : str = attr .ib (default = None )
72
76
step_type : StepTypeEnum = attr .ib (factory = StepTypeEnum .factory )
73
77
depends_on : Union [List [str ], List ["Step" ]] = attr .ib (default = None )
74
78
@@ -91,7 +95,10 @@ def to_request(self) -> RequestType:
91
95
}
92
96
if self .depends_on :
93
97
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
95
102
return request_dict
96
103
97
104
def add_depends_on (self , step_names : Union [List [str ], List ["Step" ]]):
@@ -168,6 +175,8 @@ def __init__(
168
175
self ,
169
176
name : str ,
170
177
estimator : EstimatorBase ,
178
+ display_name : str = None ,
179
+ description : str = None ,
171
180
inputs : Union [TrainingInput , dict , str , FileSystemInput ] = None ,
172
181
cache_config : CacheConfig = None ,
173
182
depends_on : Union [List [str ], List [Step ]] = None ,
@@ -180,6 +189,8 @@ def __init__(
180
189
Args:
181
190
name (str): The name of the training step.
182
191
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.
183
194
inputs (Union[str, dict, TrainingInput, FileSystemInput]): Information
184
195
about the training data. This can be one of three types:
185
196
@@ -200,7 +211,9 @@ def __init__(
200
211
depends_on (List[str] or List[Step]): A list of step names or step instances
201
212
this `sagemaker.workflow.steps.TrainingStep` depends on
202
213
"""
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
+ )
204
217
self .estimator = estimator
205
218
self .inputs = inputs
206
219
self ._properties = Properties (
@@ -248,6 +261,8 @@ def __init__(
248
261
model : Model ,
249
262
inputs : CreateModelInput ,
250
263
depends_on : Union [List [str ], List [Step ]] = None ,
264
+ display_name : str = None ,
265
+ description : str = None ,
251
266
):
252
267
"""Construct a CreateModelStep, given an `sagemaker.model.Model` instance.
253
268
@@ -261,8 +276,12 @@ def __init__(
261
276
Defaults to `None`.
262
277
depends_on (List[str] or List[Step]): A list of step names or step instances
263
278
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.
264
281
"""
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
+ )
266
285
self .model = model
267
286
self .inputs = inputs or CreateModelInput ()
268
287
@@ -304,6 +323,8 @@ def __init__(
304
323
name : str ,
305
324
transformer : Transformer ,
306
325
inputs : TransformInput ,
326
+ display_name : str = None ,
327
+ description : str = None ,
307
328
cache_config : CacheConfig = None ,
308
329
depends_on : Union [List [str ], List [Step ]] = None ,
309
330
):
@@ -317,10 +338,14 @@ def __init__(
317
338
transformer (Transformer): A `sagemaker.transformer.Transformer` instance.
318
339
inputs (TransformInput): A `sagemaker.inputs.TransformInput` instance.
319
340
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
322
345
"""
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
+ )
324
349
self .transformer = transformer
325
350
self .inputs = inputs
326
351
self .cache_config = cache_config
@@ -375,6 +400,8 @@ def __init__(
375
400
self ,
376
401
name : str ,
377
402
processor : Processor ,
403
+ display_name : str = None ,
404
+ description : str = None ,
378
405
inputs : List [ProcessingInput ] = None ,
379
406
outputs : List [ProcessingOutput ] = None ,
380
407
job_arguments : List [str ] = None ,
@@ -391,6 +418,8 @@ def __init__(
391
418
Args:
392
419
name (str): The name of the processing step.
393
420
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.
394
423
inputs (List[ProcessingInput]): A list of `sagemaker.processing.ProcessorInput`
395
424
instances. Defaults to `None`.
396
425
outputs (List[ProcessingOutput]): A list of `sagemaker.processing.ProcessorOutput`
@@ -405,7 +434,9 @@ def __init__(
405
434
depends_on (List[str] or List[Step]): A list of step names or step instance
406
435
this `sagemaker.workflow.steps.ProcessingStep` depends on
407
436
"""
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
+ )
409
440
self .processor = processor
410
441
self .inputs = inputs
411
442
self .outputs = outputs
@@ -468,6 +499,8 @@ def __init__(
468
499
self ,
469
500
name : str ,
470
501
tuner : HyperparameterTuner ,
502
+ display_name : str = None ,
503
+ description : str = None ,
471
504
inputs = None ,
472
505
job_arguments : List [str ] = None ,
473
506
cache_config : CacheConfig = None ,
@@ -481,6 +514,8 @@ def __init__(
481
514
Args:
482
515
name (str): The name of the tuning step.
483
516
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.
484
519
inputs: Information about the training data. Please refer to the
485
520
``fit()`` method of the associated estimator, as this can take
486
521
any of the following forms:
@@ -514,7 +549,9 @@ def __init__(
514
549
depends_on (List[str] or List[Step]): A list of step names or step instance
515
550
this `sagemaker.workflow.steps.ProcessingStep` depends on
516
551
"""
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
+ )
518
555
self .tuner = tuner
519
556
self .inputs = inputs
520
557
self .job_arguments = job_arguments
0 commit comments