decorators.step_decorator¶
step_decorator
¶
Classes:
Name | Description |
---|---|
Step |
|
Functions:
Name | Description |
---|---|
step |
Decorator to create a step. |
Attributes:
Name | Type | Description |
---|---|---|
F |
|
F = TypeVar('F', bound=Callable[..., Any])
module-attribute
¶
Step(continue_on_failure, entrypoint, metadata)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
bool
|
Tells if the step should be executed, even if the previous steps have failed. |
required |
|
F
|
The function to be executed when the step is called. |
required |
|
StepMetadata
|
The metadata associated to the step. |
required |
Methods:
Name | Description |
---|---|
log_step_info |
Wrapper to log step information. |
Attributes:
Name | Type | Description |
---|---|---|
id |
|
|
step_name |
|
|
continue_on_failure |
|
|
entrypoint |
|
|
metadata |
StepMetadata
|
The metadata associated to the step. |
state |
StepState
|
The step's current state. |
id = metadata.id
instance-attribute
¶
step_name = metadata.name
instance-attribute
¶
continue_on_failure = continue_on_failure
instance-attribute
¶
entrypoint = entrypoint
instance-attribute
¶
metadata
property
¶
The metadata associated to the step.
Returns:
Type | Description |
---|---|
StepMetadata
|
The metadata associated to the step. |
state
property
¶
The step's current state.
Returns:
Type | Description |
---|---|
StepState
|
The step's current state. |
step(_func=None, name=None, continue_on_failure=False)
¶
step(_func: F) -> Step
step(*, name: str | None = None, continue_on_failure: bool = False) -> Callable[[F], Step]
Decorator to create a step. The step will automatically be registered in the current pipeline and log its content inside a dedicated log file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Optional[F]
|
The decorated function. |
None
|
|
str | None
|
The name of the step. If left empty, the name of the decorated function will be used as a fallback. |
None
|
|
bool
|
Tells if the step should be executed, even if the previous steps have failed |
False
|
Returns:
Type | Description |
---|---|
Union[Step, Callable[[F], Step]]
|
A pipeline instance. |