Skip to main content

Action

A class representing an action. It is used to manage the run of a task and its state on the remote Union API.

Attributes

  • pb2: run_definition_pb2.Action
    • The protobuf definition of the action.

Constructors

  • Initializes an Action object.

     :param pb2: The Protocol Buffer representation of the Action.
    :param _details: Optional ActionDetails object for caching.

  • Parameters

    • pb2: run_definition_pb2.Action
      • The Protocol Buffer representation of the Action.
    • _details: ActionDetails | None
      • Optional ActionDetails object for caching.

Methods

def listall(for_run_name: string, filters: string | None = None, sort_by: Tuple[str, Literal["asc", "desc"]]| None = None) - > Union[Iterator[[Action](src_flyte_remote__action_action)], AsyncIterator[[Action](src_flyte_remote__action_action)]]
  • Get all actions for a given run.

     :param for_run_name: The name of the run.
    :param filters: The filters to apply to the project list.
    :param sort_by: The sorting criteria for the project list, in the format (field, order).
    :return: An iterator of projects.
  • Parameters

    • for_run_name: string
      • The name of the run.
    • filters: string | 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 Value: Union[Iterator[Action], AsyncIterator[Action]]

    • An iterator of projects.
def get(uri: string | None = None, run_name: string | None = None, name: string | None = None) - > [Action](src_flyte_remote__action_action)
  • Get a run by its ID or name. If both are provided, the ID will take precedence.

     :param uri: The URI of the action.
    :param run_name: The name of the action.
    :param name: The name of the action.
  • Parameters

    • uri: string | None
      • The URI of the action.
    • run_name: string | None
      • The name of the action.
    • name: string | None
      • The name of the action.
  • Return Value: Action

    • The Action object.
def phase()
  • Get the phase of the action.

  • Return Value: string

    • The phase of the action.
def raw_phase()
  • Get the raw phase of the action.

  • Return Value: run_definition_pb2.Phase

    • The raw phase of the action.
def name()
  • Get the name of the action.

  • Return Value: string

    • The name of the action.
def run_name()
  • Get the name of the run.

  • Return Value: string

    • The name of the run.
def task_name()
  • Get the name of the task.

  • Return Value: string | None

    • The name of the task.
def action_id()
  • Get the action ID.

  • Return Value: identifier_pb2.ActionIdentifier

    • The action ID.
def show_logs(attempt: int | None = None, max_lines: int = 30, show_ts: bool = False, raw: bool = False, filter_system: bool = False) - > Any
  • Show logs for the action.

  • Parameters

    • attempt: int | None
      • The attempt number.
    • max_lines: int
      • The maximum number of lines to show.
    • show_ts: bool
      • Whether to show timestamps.
    • raw: bool
      • Whether to show raw logs.
    • filter_system: bool
      • Whether to filter system logs.
  • Return Value: Any

    • The log viewer.
def details()
  • Get the details of the action. This is a placeholder for getting the action details.

  • Return Value: ActionDetails

    • The details of the action.
def watch(cache_data_on_done: bool = False, wait_for: WaitFor = "terminal") - > AsyncGenerator[[ActionDetails](src_flyte_remote__action_actiondetails), None]
  • Watch the action for updates. This is a placeholder for watching the action.

  • Parameters

    • cache_data_on_done: bool
      • Whether to cache data on done.
    • wait_for: WaitFor
      • The event to wait for.
  • Return Value: AsyncGenerator[ActionDetails, None]

    • An async generator yielding action details.
def wait(quiet: bool = False, wait_for: WaitFor = "terminal") - > None
  • Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure.

  • Parameters

    • quiet: bool
      • Whether to suppress output.
    • wait_for: WaitFor
      • The event to wait for.
  • Return Value: None

    • None
def done()
  • Check if the action is done.

  • Return Value: bool

    • True if the action is done, False otherwise.
def sync()
  • Sync the action with the remote server. This is a placeholder for syncing the action.

  • Return Value: Action

    • The synced action.