prefect.deployments.steps.core

Core primitives for running Prefect deployment steps. Deployment steps are YAML representations of Python functions along with their inputs. Whenever a step is run, the following actions are taken:
  • The step’s inputs and block / variable references are resolved (see the prefect deploy documentation for more details)
  • The step’s function is imported; if it cannot be found, the requires keyword is used to install the necessary packages
  • The step’s function is called with the resolved inputs
  • The step’s output is returned and used to resolve inputs for subsequent steps

Functions

run_step

run_step(step: dict[str, Any], upstream_outputs: Optional[dict[str, Any]] = None) -> dict[str, Any]
Runs a step, returns the step’s output. Steps are assumed to be in the format {"importable.func.name": {"kwarg1": "value1", ...}}. The ‘id and ‘requires’ keywords are reserved for specific purposes and will be removed from the inputs before passing to the step function: This keyword is used to specify packages that should be installed before running the step.

run_steps

run_steps(steps: List[Dict[str, Any]], upstream_outputs: Optional[Dict[str, Any]] = None, print_function: Any = print) -> dict[str, Any]

Classes

StepExecutionError

Raised when a step fails to execute.