Skip to content

fix: remove FailStep from pipelines #2155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions doc/workflows/pipelines/sagemaker.workflow.pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ Steps

.. autoclass:: sagemaker.workflow.steps.ProcessingStep

.. autoclass:: sagemaker.workflow.steps.FailStep

Utilities
---------

Expand Down
42 changes: 0 additions & 42 deletions src/sagemaker/workflow/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class StepTypeEnum(Enum, metaclass=DefaultEnumMeta):

CONDITION = "Condition"
CREATE_MODEL = "Model"
FAIL = "Fail"
PROCESSING = "Processing"
REGISTER_MODEL = "RegisterModel"
TRAINING = "Training"
Expand Down Expand Up @@ -341,44 +340,3 @@ def to_request(self) -> RequestType:
property_file.expr for property_file in self.property_files
]
return request_dict


class FailStep(Step):
"""Pipeline step to indicate failure."""

def __init__(self, name: str = "Fail"):
"""Construct a FailStep.

Causes the pipeline execution to terminate in a failed state.

Args:
name (str): The name of the step.
"""
super(FailStep, self).__init__(name, StepTypeEnum.FAIL)
root_path = f"Steps.{name}"
root_prop = Properties(path=root_path)
root_prop.__dict__["Fail"] = Properties(f"{root_path}.Fail")
self._properties = root_prop

@property
def arguments(self) -> RequestType:
"""The arguments to the particular step service call."""
return {}

@property
def properties(self):
"""The properties of the particular step."""
return self._properties

def to_request(self) -> RequestType:
"""Get the request structure for workflow service calls."""
return {
"Name": self.name,
"Type": self.step_type.value,
"Arguments": self.arguments,
}

@property
def ref(self) -> Dict[str, str]:
"""Get a reference dict for steps"""
return {"Name": self.name}