Implementation:Evidentlyai Evidently Legacy Runner
| Knowledge Sources | |
|---|---|
| Domains | Data Monitoring, Pipeline Runner |
| Last Updated | 2026-02-14 12:00 GMT |
Overview
Provides a legacy runner infrastructure for loading reference and current datasets and executing Evidently data analysis pipelines with configurable options.
Description
The Legacy Runner module defines the RunnerOptions dataclass for capturing all parameters needed to run an Evidently analysis pipeline, including paths to reference and current data, sampling options, column mappings, analysis options, and output destination. It also provides the Runner base class whose _parse_data method uses DataLoader to load and optionally sample both reference and current datasets. The parse_options function converts raw dictionary-based configuration into strongly typed option objects (such as DataDriftOptions or QualityMetricsOptions) using a predefined options_mapping registry.
This module is part of the legacy pipeline execution path. The Runner class is intended to be subclassed by specific runner implementations that add their own run logic on top of the parsed data.
Usage
Use this module when running Evidently analyses via the legacy pipeline runner interface. Create a RunnerOptions instance with all necessary paths and options, instantiate a Runner (or subclass), and call _parse_data to load the datasets prior to running analysis. Use parse_options to convert raw configuration dictionaries (e.g., from YAML or JSON config files) into the appropriate option objects.
Code Reference
Source Location
- Repository: Evidentlyai_Evidently
- File:
src/evidently/legacy/runner/runner.py
Signature
@dataclass
class RunnerOptions:
reference_data_path: str
reference_data_options: DataOptions
reference_data_sampling: Optional[SamplingOptions]
current_data_path: Optional[str]
current_data_options: Optional[DataOptions]
current_data_sampling: Optional[SamplingOptions]
column_mapping: ColumnMapping
options: List[object]
output_path: str
def parse_options(raw_dict: Optional[Dict[str, Dict[str, object]]]) -> List[object]:
...
class Runner:
def __init__(self, options: RunnerOptions):
...
def _parse_data(self):
...
Import
from evidently.legacy.runner.runner import Runner, RunnerOptions, parse_options
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| reference_data_path | str | Yes | File path to the reference dataset |
| reference_data_options | DataOptions | Yes | Options controlling how the reference data file is loaded (format, separator, etc.) |
| reference_data_sampling | Optional[SamplingOptions] | No | Optional sampling configuration for the reference data |
| current_data_path | Optional[str] | No | File path to the current dataset (may be None for reference-only analysis) |
| current_data_options | Optional[DataOptions] | No | Options controlling how the current data file is loaded |
| current_data_sampling | Optional[SamplingOptions] | No | Optional sampling configuration for the current data |
| column_mapping | ColumnMapping | Yes | Mapping of column roles (target, prediction, features, etc.) |
| options | List[object] | Yes | List of analysis option objects (e.g., DataDriftOptions, QualityMetricsOptions) |
| output_path | str | Yes | File path for writing analysis output |
Outputs
| Name | Type | Description |
|---|---|---|
| _parse_data return | Tuple[DataFrame, Optional[DataFrame]] | A tuple of (reference_data, current_data) pandas DataFrames; current_data is None if no current data path was specified |
| parse_options return | List[object] | List of instantiated option objects parsed from the raw dictionary |
Usage Examples
from evidently.legacy.runner.runner import Runner, RunnerOptions, parse_options
from evidently.legacy.runner.loader import DataOptions
from evidently.legacy.pipeline.column_mapping import ColumnMapping
# Parse options from a raw config dictionary
raw_opts = {
"data_drift": {"confidence": 0.95, "nbinsx": 10}
}
options = parse_options(raw_opts)
# Create runner options
runner_options = RunnerOptions(
reference_data_path="data/reference.csv",
reference_data_options=DataOptions(),
reference_data_sampling=None,
current_data_path="data/current.csv",
current_data_options=DataOptions(),
current_data_sampling=None,
column_mapping=ColumnMapping(),
options=options,
output_path="output/report.html",
)
# Instantiate runner and parse data
runner = Runner(runner_options)
reference_data, current_data = runner._parse_data()