Skip to main content

ActionDetails

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

Attributes​

AttributeTypeDescription
pb2run_definition_pb2.ActionDetailsUnderlying protobuf representation containing the remote execution status, identifiers, and metadata of the action.

Methods​


get_details()​

@syncify
@classmethod
async def get_details(cls, action_id: identifier_pb2.ActionIdentifier) -> ActionDetails: ...

Get the details of the action. This is a placeholder for getting the action details.

Parameters​

NameTypeDescription
action_ididentifier_pb2.ActionIdentifierThe unique identifier protobuf specifying the action to retrieve.

Returns​

TypeDescription
[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)An ActionDetails instance containing action state and configuration fetched from the remote service.

get()​

@syncify
@classmethod
async def get(
cls,
uri: str | None = None,
/,
run_name: str | None = None,
name: str | None = None,
) -> ActionDetails: ...

Get a run by its ID or name. If both are provided, the ID will take precedence.

Parameters​

NameTypeDescription
uri`strNone` = None
run_name`strNone` = None
name`strNone` = None

Returns​

TypeDescription
[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)An ActionDetails instance populated with the requested action's details.

watch()​

@syncify
@classmethod
async def watch(cls, action_id: identifier_pb2.ActionIdentifier) -> AsyncIterator[ActionDetails]: ...

Watch the action for updates. This is a placeholder for watching the action.

Parameters​

NameTypeDescription
action_ididentifier_pb2.ActionIdentifierThe unique identifier of the action to watch for status updates.

Returns​

TypeDescription
AsyncIterator[[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)]An async iterator yielding ActionDetails instances as the action's status updates until completion.

watch_updates()​

async def watch_updates(self, cache_data_on_done: bool = False) -> AsyncGenerator[ActionDetails, None]: ...

Watch for updates to the action details, yielding each update until the action is done.

Parameters​

NameTypeDescription
cache_data_on_donebool = FalseIf True, cache inputs and outputs when the action completes.

Returns​

TypeDescription
AsyncGenerator[[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails), None]An async generator yielding updated ActionDetails instances until the action terminates.

phase()​

@property
def phase(self) -> ActionPhase: ...

Get the phase of the action.

Returns​

TypeDescription
[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase)The current execution phase as an ActionPhase enum.

raw_phase()​

@property
def raw_phase(self) -> phase_pb2.ActionPhase: ...

Get the raw phase of the action.

Returns​

TypeDescription
phase_pb2.ActionPhaseThe raw protobuf enum representing the action phase.

is_running()​

@property
def is_running(self) -> bool: ...

Check if the action is currently running.

Returns​

TypeDescription
boolTrue if the action's current phase is ACTION_PHASE_RUNNING, otherwise False.

name()​

@property
def name(self) -> str: ...

Get the name of the action.

Returns​

TypeDescription
strThe string name of the action.

run_name()​

@property
def run_name(self) -> str: ...

Get the name of the run.

Returns​

TypeDescription
strThe name of the parent run associated with this action.

task_name()​

@property
def task_name(self) -> str | None: ...

Get the name of the task.

Returns​

TypeDescription
`strNone`

action_id()​

@property
def action_id(self) -> identifier_pb2.ActionIdentifier: ...

Get the action ID.

Returns​

TypeDescription
identifier_pb2.ActionIdentifierThe protobuf identifier object for this action.

metadata()​

@property
def metadata(self) -> run_definition_pb2.ActionMetadata: ...

Get the metadata of the action.

Returns​

TypeDescription
run_definition_pb2.ActionMetadataThe protobuf ActionMetadata structure associated with the action.

status()​

@property
def status(self) -> run_definition_pb2.ActionStatus: ...

Get the status of the action.

Returns​

TypeDescription
run_definition_pb2.ActionStatusThe protobuf ActionStatus containing status and execution timestamps.

error_info()​

@property
def error_info(self) -> run_definition_pb2.ErrorInfo | None: ...

Get the error information if the action failed, otherwise returns None.

Returns​

TypeDescription
`run_definition_pb2.ErrorInfoNone`

abort_info()​

@property
def abort_info(self) -> run_definition_pb2.AbortInfo | None: ...

Get the abort information if the action was aborted, otherwise returns None.

Returns​

TypeDescription
`run_definition_pb2.AbortInfoNone`

runtime()​

@property
def runtime(self) -> timedelta: ...

Get the runtime of the action.

Returns​

TypeDescription
timedeltaThe total duration of the action execution from start time to end time (or current time if running).

get_phase_transitions()​

def get_phase_transitions(self, attempt: int | None = None) -> List[PhaseTransitionInfo]: ...

Get the phase transitions for a specific attempt, showing the granular breakdown of time spent in each phase (queued, initializing, running, etc.).

Parameters​

NameTypeDescription
attempt`intNone` = None

Returns​

TypeDescription
List[PhaseTransitionInfo]List of PhaseTransitionInfo objects, one for each phase the action went through.

phase_durations()​

@property
def phase_durations(self) -> Dict[ActionPhase, timedelta]: ...

Get the duration spent in each phase as a dictionary. Returns a mapping of ActionPhase to timedelta for the latest attempt.

Returns​

TypeDescription
Dict[[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase), timedelta]Dictionary mapping ActionPhase enum values to timedelta durations.

queued_time()​

@property
def queued_time(self) -> timedelta | None: ...

Get the time spent in the QUEUED phase for the latest attempt.

Returns​

TypeDescription
`timedeltaNone`

waiting_for_resources_time()​

@property
def waiting_for_resources_time(self) -> timedelta | None: ...

Get the time spent in the WAITING_FOR_RESOURCES phase for the latest attempt.

Returns​

TypeDescription
`timedeltaNone`

initializing_time()​

@property
def initializing_time(self) -> timedelta | None: ...

Get the time spent in the INITIALIZING phase for the latest attempt.

Returns​

TypeDescription
`timedeltaNone`

running_time()​

@property
def running_time(self) -> timedelta | None: ...

Get the time spent in the RUNNING phase for the latest attempt.

Returns​

TypeDescription
`timedeltaNone`

attempts()​

@property
def attempts(self) -> int: ...

Get the number of attempts of the action.

Returns​

TypeDescription
intThe total count of execution attempts performed for this action.

logs_available()​

def logs_available(self, attempt: int | None = None) -> bool: ...

Check if logs are available for the action, optionally for a specific attempt. If attempt is None, it checks for the latest attempt.

Parameters​

NameTypeDescription
attempt`intNone` = None

Returns​

TypeDescription
boolTrue if execution logs are available for the specified or latest attempt, otherwise False.

inputs()​

async def inputs(self) -> ActionInputs: ...

Return the inputs of the action. Will return instantly if inputs are available else will fetch and return.

Returns​

TypeDescription
[ActionInputs](actioninputs.md?sid=flyte_remote__action_actioninputs)The cached or freshly fetched ActionInputs object containing input parameters.

outputs()​

async def outputs(self) -> ActionOutputs: ...

Returns the outputs of the action, returns instantly if outputs are already cached, else fetches them and returns. If Action is not in a terminal state, raise a RuntimeError.

Returns​

TypeDescription
[ActionOutputs](actionoutputs.md?sid=flyte_remote__action_actionoutputs)ActionOutputs containing the output values produced by the action execution.

done()​

def done(self) -> bool: ...

Check if the action is in a terminal state (completed or failed). This is a placeholder for checking the action state.

Returns​

TypeDescription
boolTrue if the action has reached a terminal execution phase, False otherwise.