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:
|
| METHOD | DESCRIPTION |
|---|---|
archive |
Archive a run. |
create |
Create a new run. |
find |
Find a single run matching the given query. Takes the same arguments as |
get |
Get a Run. |
list_ |
List runs with optional filtering. |
stop |
Stop a run by setting its stop time to the current time. |
unarchive |
Unarchive a run. |
update |
Update a Run. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
client |
TYPE:
|
grpc_client |
TYPE:
|
rest_client |
TYPE:
|
archive
async
¶
Archive a run.
| PARAMETER | DESCRIPTION |
|---|---|
run
|
The Run or run ID to archive.
TYPE:
|
create
async
¶
create(
create: RunCreate | dict,
assets: list[str | Asset] | None = None,
associate_new_data: bool = False,
) -> Run
Create a new run.
The behavior depends on the arguments:
- No assets: a standard run. Assets are associated later, automatically, when the run is used in their ingestion configs, so asset info is not needed up front.
- assets, associate_new_data=False (default): an adhoc run over the assets' existing data within the run's time period. Nothing is imported.
- assets, associate_new_data=True: a standard run that also captures data ingested later. Data is associated when it lands in one of the assets within the run's time period, even if its timestamp is in the past.
| PARAMETER | DESCRIPTION |
|---|---|
create
|
The run definition. For an adhoc run, set start_time and stop_time to bound the window.
TYPE:
|
assets
|
Assets to associate with the run; required when associate_new_data is True. Asset objects work in either mode. A bare string is read as an asset ID for an adhoc run, and as an asset name when associate_new_data is True.
TYPE:
|
associate_new_data
|
If True, associate data ingested after the run is created that falls within its time period. Requires assets.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Run
|
The created Run. |
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
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Run | None
|
The Run found or None. |
get
async
¶
get(
*,
run_id: str | None = None,
client_key: str | None = None,
) -> Run
Get a Run.
| PARAMETER | DESCRIPTION |
|---|---|
run_id
|
The ID of the run.
TYPE:
|
client_key
|
The client key of the run.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Run
|
The Run. |
list_
async
¶
list_(
*,
name: str | None = None,
names: list[str] | None = None,
name_contains: str | None = None,
name_regex: str | Pattern | None = None,
run_ids: list[str] | None = None,
client_keys: list[str] | None = None,
created_after: datetime | None = None,
created_before: datetime | None = None,
modified_after: datetime | None = None,
modified_before: datetime | None = None,
created_by: Any | str | None = None,
modified_by: Any | str | None = None,
tags: list[str | Tag] | None = None,
metadata: list[Any] | None = None,
assets: list[Asset] | list[str] | None = None,
asset_tags: list[str | Tag] | None = None,
duration_less_than: timedelta | None = None,
duration_greater_than: timedelta | None = None,
start_time_after: datetime | None = None,
start_time_before: datetime | None = None,
stop_time_after: datetime | None = None,
stop_time_before: datetime | None = None,
is_stopped: bool | None = None,
description_contains: str | None = None,
include_archived: bool = False,
filter_query: str | None = None,
order_by: str | None = None,
limit: int | None = None,
page_size: int | None = None,
) -> list[Run]
List runs with optional filtering.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
Exact name of the run.
TYPE:
|
names
|
List of run names to filter by.
TYPE:
|
name_contains
|
Partial name of the run.
TYPE:
|
name_regex
|
Regular expression to filter runs by name.
TYPE:
|
run_ids
|
Filter to runs with any of these IDs.
TYPE:
|
client_keys
|
Filter to runs with any of these client keys.
TYPE:
|
created_after
|
Filter runs created after this datetime.
TYPE:
|
created_before
|
Filter runs created before this datetime.
TYPE:
|
modified_after
|
Filter runs modified after this datetime.
TYPE:
|
modified_before
|
Filter runs modified before this datetime.
TYPE:
|
created_by
|
Filter runs created by this User or user ID.
TYPE:
|
modified_by
|
Filter runs last modified by this User or user ID.
TYPE:
|
tags
|
Filter runs with any of these Tags IDs.
TYPE:
|
metadata
|
Filter runs by metadata criteria.
TYPE:
|
assets
|
Filter runs associated with any of these Assets or asset IDs.
TYPE:
|
asset_tags
|
Filter runs associated with any Assets that have these Tag IDs.
TYPE:
|
duration_less_than
|
Filter runs with duration less than this time.
TYPE:
|
duration_greater_than
|
Filter runs with duration greater than this time.
TYPE:
|
start_time_after
|
Filter runs that started after this datetime.
TYPE:
|
start_time_before
|
Filter runs that started before this datetime.
TYPE:
|
stop_time_after
|
Filter runs that stopped after this datetime.
TYPE:
|
stop_time_before
|
Filter runs that stopped before this datetime.
TYPE:
|
is_stopped
|
Whether the run is stopped.
TYPE:
|
description_contains
|
Partial description of the run.
TYPE:
|
include_archived
|
If True, include archived runs in results.
TYPE:
|
filter_query
|
Explicit CEL query to filter runs.
TYPE:
|
order_by
|
Field and direction to order results by.
TYPE:
|
limit
|
Maximum number of runs to return. If None, returns all matches.
TYPE:
|
page_size
|
Number of results to fetch per request. Lower this if you hit gRPC message size limits on responses. If None, uses the server default.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Run]
|
A list of Run objects that match the filter criteria. |
stop
async
¶
Stop a run by setting its stop time to the current time.
| PARAMETER | DESCRIPTION |
|---|---|
run
|
The Run or run ID to stop.
TYPE:
|