Run
Package: flyte.remote
A class representing a run of a task. It is used to manage the run of a task and its state on the remote Union API.
class Run(
pb2: run_definition_pb2.Run,
_details: RunDetails | None,
_preserve_original_types: bool,
)| Parameter | Type | Description |
|---|---|---|
pb2 |
run_definition_pb2.Run |
|
_details |
RunDetails | None |
|
_preserve_original_types |
bool |
Properties
| Property | Type | Description |
|---|---|---|
name |
None |
Get the name of the run. |
phase |
None |
Get the phase of the run. |
raw_phase |
None |
Get the raw phase of the run. |
url |
None |
Get the URL of the run. |
Methods
| Method | Description |
|---|---|
abort() |
Aborts / Terminates the run. |
details() |
Get the details of the run. |
done() |
Check if the run is done. |
get() |
Get the current run. |
get_debug_url() |
Get the debug URL of the run. |
get_logs() |
Get logs for the run as an iterator of strings. |
inputs() |
Get the inputs of the run. |
listall() |
Get all runs for the current project and domain. |
outputs() |
Get the outputs of the run. |
show_logs() |
|
sync() |
Sync the run with the remote server. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
wait() |
Wait for the run to complete, displaying a rich progress panel with status transitions,. |
watch() |
Watch the run for updates, updating the internal Run state with latest details. |
abort()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.abort.aio().
def abort(
reason: str,
)Aborts / Terminates the run.
| Parameter | Type | Description |
|---|---|---|
reason |
str |
details()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.details.aio().
def details()Get the details of the run. This is a placeholder for getting the run details.
done()
def done()Check if the run is done.
get()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Run.get.aio().
def get(
cls,
name: str,
) -> RunGet the current run.
:return: The current run.
| Parameter | Type | Description |
|---|---|---|
cls |
||
name |
str |
get_debug_url()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.get_debug_url.aio().
def get_debug_url()Get the debug URL of the run. Returns None if the VS Code
Debugger log entry is not yet available in the action details.
get_logs()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.get_logs.aio().
def get_logs(
attempt: int | None,
filter_system: bool,
show_ts: bool,
) -> AsyncGenerator[str, None]Get logs for the run as an iterator of strings.
Can be called synchronously (returns Iterator[str]) or asynchronously
via .aio() (returns AsyncIterator[str]).
| Parameter | Type | Description |
|---|---|---|
attempt |
int | None |
The attempt number to retrieve logs for (defaults to latest attempt). |
filter_system |
bool |
If True, filter out system-generated log lines. |
show_ts |
bool |
If True, prefix each line with an ISO-8601 timestamp. |
inputs()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.inputs.aio().
def inputs()Get the inputs of the run. This is a placeholder for getting the run inputs.
listall()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Run.listall.aio().
def listall(
cls,
in_phase: Tuple[ActionPhase | str, ...] | None,
task_name: str | None,
task_version: str | None,
created_by_subject: str | None,
sort_by: Tuple[str, Literal['asc', 'desc']] | None,
limit: int,
project: str | None,
domain: str | None,
created_at: TimeFilter | None,
updated_at: TimeFilter | None,
) -> AsyncIterator[Run]Get all runs for the current project and domain.
| Parameter | Type | Description |
|---|---|---|
cls |
||
in_phase |
Tuple[ActionPhase | str, ...] | None |
Filter runs by one or more phases. |
task_name |
str | None |
Filter runs by task name. |
task_version |
str | None |
Filter runs by task version. |
created_by_subject |
str | None |
Filter runs by the subject that created them. (this is not username, but the subject) |
sort_by |
Tuple[str, Literal['asc', 'desc']] | None |
The sorting criteria for the Run list, in the format (field, order). |
limit |
int |
The maximum number of runs to return. |
project |
str | None |
The project to list runs for. Defaults to the globally configured project. |
domain |
str | None |
The domain to list runs for. Defaults to the globally configured domain. |
created_at |
TimeFilter | None |
Filter runs by creation time range. |
updated_at |
TimeFilter | None |
Filter runs by last-update time range. :return: An iterator of runs. |
outputs()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.outputs.aio().
def outputs()Get the outputs of the run. This is a placeholder for getting the run outputs.
show_logs()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.show_logs.aio().
def show_logs(
attempt: int | None,
max_lines: int,
show_ts: bool,
raw: bool,
filter_system: bool,
)| Parameter | Type | Description |
|---|---|---|
attempt |
int | None |
|
max_lines |
int |
|
show_ts |
bool |
|
raw |
bool |
|
filter_system |
bool |
sync()
def sync()Sync the run with the remote server. This is a placeholder for syncing the run.
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
wait()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await <Run instance>.wait.aio().
def wait(
quiet: bool,
wait_for: Literal['terminal', 'running'],
)Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure.
This method updates the Run’s internal state, ensuring that properties like
run.action.phase reflect the final state after waiting completes.
| Parameter | Type | Description |
|---|---|---|
quiet |
bool |
|
wait_for |
Literal['terminal', 'running'] |
watch()
def watch(
cache_data_on_done: bool,
) -> AsyncGenerator[ActionDetails, None]Watch the run for updates, updating the internal Run state with latest details.
This method updates the Run’s action state, ensuring that properties like
run.action.phase reflect the current state after watching.
| Parameter | Type | Description |
|---|---|---|
cache_data_on_done |
bool |