Action
Package: flyte.remote
A class representing an action. It is used to manage the run of a task and its state on the remote Union API.
class Action(
pb2: run_definition_pb2.Action,
_details: ActionDetails | None,
)| Parameter | Type | Description |
|---|---|---|
pb2 |
run_definition_pb2.Action |
|
_details |
ActionDetails | None |
Methods
| Method | Description |
|---|---|
details() |
Get the details of the action. |
done() |
Check if the action is done. |
get() |
Get a run by its ID or name. |
listall() |
Get all actions for a given run. |
show_logs() |
|
sync() |
Sync the action 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 action for updates. |
details()
def details()Get the details of the action. This is a placeholder for getting the action details.
done()
def done()Check if the action 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 Action.get.aio().
def get(
cls,
uri: str | None,
run_name: str | None,
name: str | None,
) -> ActionGet a run by its ID or name. If both are provided, the ID will take precedence.
| Parameter | Type | Description |
|---|---|---|
cls |
||
uri |
str | None |
The URI of the action. |
run_name |
str | None |
The name of the action. |
name |
str | None |
The name of the action. |
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 Action.listall.aio().
def listall(
cls,
for_run_name: str,
filters: str | None,
sort_by: Tuple[str, Literal['asc', 'desc']] | None,
) -> Union[Iterator[Action], AsyncIterator[Action]]Get all actions for a given run.
| Parameter | Type | Description |
|---|---|---|
cls |
||
for_run_name |
str |
The name of the run. |
filters |
str | None |
The filters to apply to the project list. |
sort_by |
Tuple[str, Literal['asc', 'desc']] | None |
The sorting criteria for the project list, in the format (field, order). :return: An iterator of projects. |
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 <Action 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 action with the remote server. This is a placeholder for syncing the action.
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()
def wait(
quiet: bool,
wait_for: WaitFor,
)Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure.
| Parameter | Type | Description |
|---|---|---|
quiet |
bool |
|
wait_for |
WaitFor |
watch()
def watch(
cache_data_on_done: bool,
wait_for: WaitFor,
) -> AsyncGenerator[ActionDetails, None]Watch the action for updates. This is a placeholder for watching the action.
| Parameter | Type | Description |
|---|---|---|
cache_data_on_done |
bool |
|
wait_for |
WaitFor |
Properties
| Property | Type | Description |
|---|---|---|
action_id |
None |
Get the action ID. |
name |
None |
Get the name of the action. |
phase |
None |
Get the phase of the action. |
raw_phase |
None |
Get the raw phase of the action. |
run_name |
None |
Get the name of the run. |
task_name |
None |
Get the name of the task. |