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.
Note on assets: You do not need to provide asset info when creating a run. If you pass a Run to future ingestion configs associated with assets, the association will happen automatically then. However, if you do pass assets and set associate_new_data=True, future ingested data that falls within the Run's time period will be associated with the Run. Even if that data's timestamp is in the past, if it has not been ingested yet and the Run's timestamp envelopes it, it will be associated with the Run. This may be useful if you want to capture a time range for a specific asset or won't know about this Run when ingesting to that asset. If the data has already been ingested, leave associate_new_data=False.
| PARAMETER | DESCRIPTION |
|---|---|
create
|
The Run definition to create.
TYPE:
|
assets
|
List of assets to associate with the run. Note: if you are associating new data, you must provide assets/asset names.
TYPE:
|
associate_new_data
|
If True, future ingested data that falls within the Run's time period will be associated with the Run. Even if that data's timestamp is in the past, if it has not been ingested yet and the Run's timestamp envelopes it, it will be associated with the Run.
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,
) -> 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:
|
| 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:
|