Skip to content

Execution engine

Engine and configuration

Use Uptimely.run() or Uptimely.create_engine() to apply project configuration. Constructing Engine directly does not load a TOML file. Supply EngineConfig, parameters, and paths explicitly when using it independently.

Execution engine for plans in validated project build bundles.

Engine

Execute the plan in a validated project build bundle.

bundle instance-attribute

bundle = bundle

plan instance-attribute

plan = bundle.execution_plan

spec_definition instance-attribute

spec_definition = bundle.spec_definition

config instance-attribute

config = config_module.EngineConfig() if config is None else config

parameters instance-attribute

parameters = project_config.Params.model_validate({} if parameters is None else dict(parameters)).root

paths instance-attribute

paths = project_config.Paths.model_validate({} if paths is None else dict(paths)).root

code_settings instance-attribute

code_settings = code_config.CodeSettings() if code_settings is None else code_settings

backend instance-attribute

backend = backend.PolarsBackend()

check_plan_backend

check_plan_backend() -> None

Require the built-in backend to support the saved plan.

Raises:

Type Description
ValueError

The plan requires a different dataframe backend.

run

run(*, validate: bool = False, preview_rows: int | None = None, operator: tuple[str, str] | None = None, src_path: Path | None = None) -> result.ExecutionResult

Execute the plan and overwrite the project's latest-run artifacts.

Parameters:

Name Type Description Default
validate bool

Check invocation inputs and outputs against their analytical contracts. Lazy checks may execute upstream queries repeatedly.

False
preview_rows int | None

Positive maximum sample size per profile. Defaults to the Engine config value. Lazy previews execute bounded queries after execution; timing excludes previews.

None
operator tuple[str, str] | None

Request targeted execution, which is not yet supported.

None
src_path Path | None

Optional source directory, relative to the project root unless absolute. Defaults to bundled source, then configured or default project source.

None

Returns:

Type Description
ExecutionResult

Dataset aliases, invocation statuses, execution duration, collected

ExecutionResult

preview frames, and separately reported preview failures. Calculated

ExecutionResult

feature outputs are unavailable and reported as None.

Raises:

Type Description
NotImplementedError

Targeted execution was requested.

OSError

Run artifacts cannot be persisted.

ValueError

The preview row limit is invalid. The Python runtime requirements are invalid or not satisfied.

Runtime configuration for project plan execution.

EngineConfig

Bases: BaseModel

Runtime configuration for an execution engine.

model_config class-attribute instance-attribute

model_config = pydantic.ConfigDict(extra='forbid', frozen=True)

preview_rows class-attribute instance-attribute

preview_rows: int = pydantic.Field(default=DEFAULT_PREVIEW_ROWS, gt=0, strict=True)