Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Evidentlyai Evidently SDK Datasets

From Leeroopedia
Revision as of 12:29, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Evidentlyai_Evidently_SDK_Datasets.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains SDK, Data Management
Last Updated 2026-02-14 12:00 GMT

Overview

Provides the RemoteDatasetsManager class and associated data models for listing, loading, and uploading datasets to a remote Evidently workspace.

Description

The SDK Datasets module implements the client-side dataset management interface for the Evidently SDK. It enables programmatic interaction with datasets stored in a remote Evidently workspace.

Key classes:

  • DatasetInfo -- A Pydantic model containing metadata about a dataset stored in the workspace. Fields include id, project_id, name, size_bytes, row_count, column_count, description, created_at, author_name, origin, tags, and metadata.
  • DatasetList -- A Pydantic model wrapping a list of DatasetInfo objects. Provides a formatted __repr__ method that displays dataset details in a human-readable format.
  • RemoteDatasetsManager -- The main manager class that provides three operations:
    • list(project, origins) -- Lists all datasets in a project with optional origin filtering. Makes a GET request to the datasets API endpoint. Returns a DatasetList.
    • load(dataset_id) -- Downloads a dataset by ID. Reads a multipart response containing metadata and a Parquet file, reconstructs the DataFrame and DataDefinition, and returns a Dataset object.
    • add(project_id, dataset, name, description, link) -- Uploads a dataset to the workspace. Serializes the DataFrame as Parquet, the data definition as JSON, and sends them as a multipart form POST request. Supports optional SnapshotLink to associate the dataset with a specific snapshot. Returns the new DatasetID.

The manager is initialized with a RemoteWorkspace instance and a base URL path for the datasets API.

Usage

Use RemoteDatasetsManager through the RemoteWorkspace.datasets property to manage datasets programmatically. This is useful for uploading evaluation data, downloading datasets for local analysis, or listing available datasets in a project. The manager handles serialization/deserialization of DataFrames to/from Parquet format transparently.

Code Reference

Source Location

Signature

class DatasetInfo(BaseModel):
    id: DatasetID
    project_id: ProjectID
    name: str
    size_bytes: int
    row_count: int
    column_count: int
    description: str
    created_at: datetime
    author_name: Optional[str] = None
    origin: str
    tags: List[str]
    metadata: Dict[str, MetadataValueType]

class DatasetList(BaseModel):
    datasets: List[DatasetInfo]

class RemoteDatasetsManager:
    def __init__(self, workspace: "RemoteWorkspace", base_dataset_url: str):
        ...
    def list(self, project: STR_UUID, origins: Optional[List[str]] = None) -> DatasetList:
        ...
    def load(self, dataset_id: DatasetID) -> Dataset:
        ...
    def add(self, project_id: STR_UUID, dataset: Dataset, name: str,
            description: Optional[str] = None, link: Optional[SnapshotLink] = None) -> DatasetID:
        ...

Import

from evidently.sdk.datasets import RemoteDatasetsManager, DatasetInfo, DatasetList

I/O Contract

Inputs

Name Type Required Description
workspace RemoteWorkspace Yes (constructor) The remote workspace instance used for making API calls
base_dataset_url str Yes (constructor) Base URL path for dataset API endpoints (e.g., "/api/datasets")
project STR_UUID Yes (for list) Project ID to list datasets for
origins Optional[List[str]] No (for list) Optional origin filters (e.g., ["upload", "snapshot"])
dataset_id DatasetID Yes (for load) ID of the dataset to download
project_id STR_UUID Yes (for add) Project ID to upload the dataset to
dataset Dataset Yes (for add) The Dataset object to upload
name str Yes (for add) Name for the uploaded dataset
description Optional[str] No (for add) Optional description for the dataset
link Optional[SnapshotLink] No (for add) Optional snapshot link to associate the dataset with a snapshot

Outputs

Name Type Description
list return DatasetList List of DatasetInfo objects with metadata about each dataset
load return Dataset A Dataset object with DataFrame and DataDefinition reconstructed from the remote Parquet file
add return DatasetID The UUID of the newly uploaded dataset

Usage Examples

from evidently.ui.workspace import RemoteWorkspace

# Connect to remote workspace
ws = RemoteWorkspace("https://app.evidently.cloud", token="my-token")

# List all datasets in a project
dataset_list = ws.datasets.list(project="project-uuid")
print(dataset_list)

# Load a specific dataset
dataset = ws.datasets.load(dataset_id="dataset-uuid")
df = dataset.as_dataframe()

# Upload a new dataset
from evidently.core.datasets import Dataset
import pandas as pd

new_dataset = Dataset.from_pandas(pd.read_csv("data.csv"))
dataset_id = ws.datasets.add(
    project_id="project-uuid",
    dataset=new_dataset,
    name="Production Data Q1",
    description="Production data from Q1 2026",
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment