10
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
11
# ANY KIND, either express or implied. See the License for the specific
12
12
# language governing permissions and limitations under the License.
13
- """The step definitions for workflow ."""
13
+ """The `Step` definitions for SageMaker Pipelines Workflows ."""
14
14
from __future__ import absolute_import
15
15
16
16
from typing import List , Union
23
23
24
24
25
25
class FailStep (Step ):
26
- """Fail step for workflow ."""
26
+ """`FailStep` for SageMaker Pipelines Workflows ."""
27
27
28
28
def __init__ (
29
29
self ,
@@ -33,17 +33,17 @@ def __init__(
33
33
description : str = None ,
34
34
depends_on : Union [List [str ], List [Step ]] = None ,
35
35
):
36
- """Constructs a FailStep.
36
+ """Constructs a ` FailStep` .
37
37
38
38
Args:
39
- name (str): The name of the Fail step .
40
- error_message (str or PipelineNonPrimitiveInputTypes): Error message defined by user.
41
- Once the Fail step is reached the execution will fail and the
42
- error message will be set as the failure reason (default: None).
43
- display_name (str): The display name of the Fail step (default: None).
44
- description (str): The description of the Fail step (default: None).
45
- depends_on (List[str] or List[Step]): A list of step names or step instances
46
- this `sagemaker.workflow.steps.FailStep` depends on (default: None).
39
+ name (str): The name of the `FailStep`. A name is required and must be unique within a pipeline .
40
+ error_message (str or PipelineNonPrimitiveInputTypes): An error message defined by the user.
41
+ Once the `FailStep` is reached, the execution fails and the
42
+ error message is set as the failure reason (default: None).
43
+ display_name (str): The display name of the `FailStep`. The display name provides better UI readability. (default: None).
44
+ description (str): The description of the `FailStep` (default: None).
45
+ depends_on (List[str] or List[Step]): A list of `Step` names or `Step` instances that this `FailStep` depends on.
46
+ If a listed `Step` name does not exist, an error is returned (default: None).
47
47
"""
48
48
super (FailStep , self ).__init__ (
49
49
name , display_name , description , StepTypeEnum .FAIL , depends_on
@@ -52,13 +52,14 @@ def __init__(
52
52
53
53
@property
54
54
def arguments (self ) -> RequestType :
55
- """The arguments dict that is used to define the Fail step ."""
55
+ """The arguments dictionary that is used to define the `FailStep` ."""
56
56
return dict (ErrorMessage = self .error_message )
57
57
58
58
@property
59
59
def properties (self ):
60
- """A Properties object is not available for the Fail step"""
60
+ """A `Properties` object is not available for the `FailStep`. Executing a `FailStep` will terminate the pipeline.
61
+ `FailStep` properties should not be referenced and no other `Step` should depend on the `FailStep`."""
61
62
raise RuntimeError (
62
- "The Properties object is not available for the Fail step "
63
+ "The Properties object is not available for the FailStep "
63
64
+ "as it cannot be referenced by other steps."
64
65
)
0 commit comments