Skip to content

sift_client.resources.runs

CLASS DESCRIPTION
RunsAPIAsync

High-level API for interacting with runs.

RunsAPIAsync

RunsAPIAsync(sift_client: SiftClient)

Bases: ResourceBase

High-level API for interacting with runs.

This class provides a Pythonic, notebook-friendly interface for interacting with the RunsAPI. It handles automatic handling of gRPC services, seamless type conversion, and clear error handling.

All methods in this class use the Run class from the low-level wrapper, which is a user-friendly representation of a run using standard Python data structures and types.

Initialize the RunsAPI.

PARAMETER DESCRIPTION
sift_client

The Sift client to use.

TYPE: SiftClient

METHOD DESCRIPTION
archive

Archive a run.

create

Create a new run.

create_automatic_association_for_assets

Associate assets with a run for automatic data ingestion.

find

Find a single run matching the given query. Takes the same arguments as list. If more than one run is found,

get

Get a Run.

list_

List runs with optional filtering.

stop

Stop a run by setting its stop time to the current time.

stop_run

Stop a run by setting its stop time to the current time.

update

Update a Run.

archive async

archive(*, run: str | Run) -> None

Archive a run.

PARAMETER DESCRIPTION
run

The Run or run ID to archive.

TYPE: str | Run

create async

create(
    name: str,
    description: str,
    tags: list[str] | None = None,
    start_time: datetime | None = None,
    stop_time: datetime | None = None,
    organization_id: str | None = None,
    client_key: str | None = None,
    metadata: dict[str, str | float | bool] | None = None,
) -> Run

Create a new run.

PARAMETER DESCRIPTION
name

The name of the run.

TYPE: str

description

The description of the run.

TYPE: str

tags

Tags to associate with the run.

TYPE: list[str] | None DEFAULT: None

start_time

The start time of the run.

TYPE: datetime | None DEFAULT: None

stop_time

The stop time of the run.

TYPE: datetime | None DEFAULT: None

organization_id

The organization ID.

TYPE: str | None DEFAULT: None

client_key

A unique client key for the run.

TYPE: str | None DEFAULT: None

metadata

Metadata values for the run.

TYPE: dict[str, str | float | bool] | None DEFAULT: None

RETURNS DESCRIPTION
Run

The created Run.

create_automatic_association_for_assets async

create_automatic_association_for_assets(
    run: str | Run, asset_names: list[str]
) -> None

Associate assets with a run for automatic data ingestion.

PARAMETER DESCRIPTION
run

The Run or run ID.

TYPE: str | Run

asset_names

List of asset names to associate.

TYPE: list[str]

find async

find(**kwargs) -> Run | None

Find a single run matching the given query. Takes the same arguments as list. If more than one run is found, raises an error.

PARAMETER DESCRIPTION
**kwargs

Keyword arguments to pass to list.

DEFAULT: {}

RETURNS DESCRIPTION
Run | None

The Run found or None.

get async

get(*, run_id: str) -> Run

Get a Run.

PARAMETER DESCRIPTION
run_id

The ID of the run.

TYPE: str

RETURNS DESCRIPTION
Run

The Run.

list_ async

list_(
    *,
    name: str | None = None,
    name_contains: str | None = None,
    name_regex: str | Pattern | None = None,
    description: str | None = None,
    description_contains: str | None = None,
    duration_seconds: int | None = None,
    client_key: str | None = None,
    asset_id: str | None = None,
    asset_name: str | None = None,
    created_by_user_id: str | None = None,
    is_stopped: bool | None = None,
    include_archived: bool = False,
    order_by: str | None = None,
    limit: int | None = None,
) -> list[Run]

List runs with optional filtering.

PARAMETER DESCRIPTION
name

Exact name of the run.

TYPE: str | None DEFAULT: None

name_contains

Partial name of the run.

TYPE: str | None DEFAULT: None

name_regex

Regular expression string to filter runs by name.

TYPE: str | Pattern | None DEFAULT: None

description

Exact description of the run.

TYPE: str | None DEFAULT: None

description_contains

Partial description of the run.

TYPE: str | None DEFAULT: None

duration_seconds

Duration of the run in seconds.

TYPE: int | None DEFAULT: None

client_key

Client key to filter by.

TYPE: str | None DEFAULT: None

asset_id

Asset ID to filter by.

TYPE: str | None DEFAULT: None

asset_name

Asset name to filter by.

TYPE: str | None DEFAULT: None

created_by_user_id

User ID who created the run.

TYPE: str | None DEFAULT: None

is_stopped

Whether the run is stopped.

TYPE: bool | None DEFAULT: None

include_archived

Whether to include archived runs.

TYPE: bool DEFAULT: False

order_by

How to order the retrieved runs.

TYPE: str | None DEFAULT: None

limit

How many runs to retrieve. If None, retrieves all matches.

TYPE: int | None DEFAULT: None

RETURNS DESCRIPTION
list[Run]

A list of Runs that matches the filter.

stop async

stop(*, run: str | Run) -> None

Stop a run by setting its stop time to the current time.

PARAMETER DESCRIPTION
run

The Run or run ID to stop.

TYPE: str | Run

stop_run async

stop_run(run: str | Run) -> None

Stop a run by setting its stop time to the current time.

PARAMETER DESCRIPTION
run

The Run or run ID to stop.

TYPE: str | Run

update async

update(run: str | Run, update: RunUpdate | dict) -> Run

Update a Run.

PARAMETER DESCRIPTION
run

The Run or run ID to update.

TYPE: str | Run

update

Updates to apply to the Run.

TYPE: RunUpdate | dict

RETURNS DESCRIPTION
Run

The updated Run.