## StepError


A failure raised while fitting or transforming a step.


Usage

``` python
StepError(
    step_id,
    step_type,
    columns,
    phase,
)
```


The recipe wraps any exception raised from a step's [fit()](Step.fit.md#mlfeatures.Step.fit) or [transform()](Step.transform.md#mlfeatures.Step.transform) in a [StepError](StepError.md#mlfeatures.StepError) and chains the original with `raise ... from`, so the underlying traceback is preserved. The wrapper attaches the offending step's `id`, its type, and the column(s) it was operating on, so a failure deep inside a pipeline says *which* step broke without the user having to read the whole stack.


## Attributes


`step_id`  
The `id` of the step that failed.

`step_type`  
The step's snake-case type name (e.g. `'step_normalize'`).

`columns`  
The column(s) the step was operating on, or `[]` if unknown.

`phase`  
`'fit'` or `'transform'`: the lifecycle stage the failure occurred in.
