e steps

from zenml.steps import StepContext, stepfrom zenml.environment import Environment

@step

def my_step(context: StepContext) -> Any:  # Old: `StepContext` class defined as arg

env = Environment().step_environment

output_uri = context.get_output_artifact_uri()

step_name = env.step_name  # Old: Run info accessible via `StepEnvironment`

...

from zenml import get_step_context, step

@step

def my_step() -> Any:  # New: StepContext is no longer an argument of the step

context = get_step_context()

output_uri = context.get_output_artifact_uri()

step_name = context.step_name  # New: StepContext now has ALL run/step info

...

Check out this page for more information on how to fetch run information inside your steps using get_step_context().

PreviousMigration guide 0.23.0 → 0.30.0

NextCommunity & content

Last updated 15 days ago