Skip to content

Commit fa9f008

Browse files
Tioga failstep (#1)
* Clarified FailStep doc string * Added description of name and display_name * Grammar fix for error_message FailStep docstring * Fixed formatting issue for display_name FailStep docstring * Standardized style for all Steps entries and clarified FailStep parameter descriptions * Changed passive voice to active and finalized FailStep docstrings * Fixed code block formatting typos for steps.py Co-authored-by: qidewenwhen <[email protected]>
1 parent 2332530 commit fa9f008

File tree

2 files changed

+137
-137
lines changed

2 files changed

+137
-137
lines changed

src/sagemaker/workflow/fail_step.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
13-
"""The step definitions for workflow."""
13+
"""The `Step` definitions for SageMaker Pipelines Workflows."""
1414
from __future__ import absolute_import
1515

1616
from typing import List, Union
@@ -23,7 +23,7 @@
2323

2424

2525
class FailStep(Step):
26-
"""Fail step for workflow."""
26+
"""`FailStep` for SageMaker Pipelines Workflows."""
2727

2828
def __init__(
2929
self,
@@ -33,17 +33,17 @@ def __init__(
3333
description: str = None,
3434
depends_on: Union[List[str], List[Step]] = None,
3535
):
36-
"""Constructs a FailStep.
36+
"""Constructs a `FailStep`.
3737
3838
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).
4747
"""
4848
super(FailStep, self).__init__(
4949
name, display_name, description, StepTypeEnum.FAIL, depends_on
@@ -52,13 +52,14 @@ def __init__(
5252

5353
@property
5454
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`."""
5656
return dict(ErrorMessage=self.error_message)
5757

5858
@property
5959
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`."""
6162
raise RuntimeError(
62-
"The Properties object is not available for the Fail step "
63+
"The Properties object is not available for the FailStep "
6364
+ "as it cannot be referenced by other steps."
6465
)

0 commit comments

Comments
 (0)