arately

my_step()

# Define a Pipeline

@pipelinedef my_pipeline():

my_step(param_1=17)

# Configure and run the Pipeline

my_pipeline = my_pipeline.with_options(enable_cache=False, schedule=schedule)

my_pipeline()

# Fetch the Pipeline Run

last_run = my_pipeline.last_run

int_output = last_run.steps["my_step"].outputs["int_output"].load()

Defining steps

from zenml.steps import step, BaseParameters

from zenml.pipelines import pipeline

# Old: Subclass `BaseParameters` to define parameters for a step

class MyStepParameters(BaseParameters):

param_1: int

param_2: Optional[float] = None

@step

def my_step(params: MyStepParameters) -> None:

...

@pipeline

def my_pipeline(my_step):

my_step()

step_instance = my_step(params=MyStepParameters(param_1=17))

pipeline_instance = my_pipeline(my_step=step_instance)

# New: Directly define the parameters as arguments of your step function.

# In case you still want to group your parameters in a separate class,

# you can subclass `pydantic.BaseModel` and use that as an argument of your

# step function

from zenml import pipeline, step

@step

def my_step(param_1: int, param_2: Optional[float] = None) -> None:

...

@pipeline

def my_pipeline():

my_step(param_1=17)

Check out this page for more information on how to parameterize your steps.

Calling a step outside of a pipeline

from zenml.steps import step

@step

def my_step() -> None:

...

my_step.entrypoint()  # Old: Call `step.entrypoint(...)`

from zenml import step

@step

def my_step() -> None:

...

my_step()  # New: Call the step directly `step(...)`

Defining pipelines

from zenml.pipelines import pipeline

@pipeline

def my_pipeline(my_step):  # Old: steps are arguments of the pipeline function

my_step()

from zenml import pipeline, step

@step

def my_step() -> None:

...

@pipeline

def my_pipeline():

my_step()  # New: The pipeline function calls the step directly

Configuring pipelines

from zenml.pipelines import pipeline

from zenml.steps import step

@step

def my_step() -> None:

...