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.ActionDetailsThe underlying protobuf message containing the raw action details from the remote API.

Constructor

Signature

def ActionDetails(
pb2: run_definition_pb2.ActionDetails,
_inputs: ActionInputs | None = None,
_outputs: ActionOutputs | None = None,
_preserve_original_types: bool = False
) - > null

Parameters

NameTypeDescription
pb2run_definition_pb2.ActionDetailsThe protobuf definition containing the action's details.
_inputs`ActionInputsNone` = None
_outputs`ActionOutputsNone` = None
_preserve_original_typesbool = FalseFlag indicating whether to preserve original types during data conversion.

Methods


get_details()

@classmethod
def get_details(
action_id: identifier_pb2.ActionIdentifier
) - > [ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)

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

Parameters

NameTypeDescription
action_ididentifier_pb2.ActionIdentifierThe unique identifier for the action to retrieve

Returns

TypeDescription
[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)An object containing the full state and configuration of the specified action

get()

@classmethod
def get(
uri: str | null = null,
run_name: str | null = null,
name: str | null = null
) - > [ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)

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

Parameters

NameTypeDescription
uri`strnull` = null
run_name`strnull` = null
name`strnull` = null

Returns

TypeDescription
[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)The action details corresponding to the provided URI or name

watch()

@classmethod
def watch(
action_id: identifier_pb2.ActionIdentifier
) - > AsyncIterator[[ActionDetails](actiondetails.md?sid=flyte_remote__action_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 monitor

Returns

TypeDescription
AsyncIterator[[ActionDetails](actiondetails.md?sid=flyte_remote__action_actiondetails)]An asynchronous iterator yielding updated action details until the action reaches a terminal state

watch_updates()

@classmethod
def watch_updates(
cache_data_on_done: bool = false
) - > AsyncGenerator[[ActionDetails](actiondetails.md?sid=flyte_remote__action_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 asynchronous generator yielding the latest action state updates

phase()

@classmethod
def phase() - > [ActionPhase](../../models/actionphase.md?sid=flyte_models_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()

@classmethod
def raw_phase() - > phase_pb2.ActionPhase

Get the raw phase of the action.

Returns

TypeDescription
phase_pb2.ActionPhaseThe underlying protobuf representation of the action's current phase

is_running()

@classmethod
def is_running() - > bool

Check if the action is currently running.

Returns

TypeDescription
boolTrue if the action phase is currently in the running state, False otherwise

name()

@classmethod
def name() - > str

Get the name of the action.

Returns

TypeDescription
strThe string identifier for the specific action

run_name()

@classmethod
def run_name() - > str

Get the name of the run.

Returns

TypeDescription
strThe name of the parent run associated with this action

task_name()

@classmethod
def task_name() - > str | null

Get the name of the task.

Returns

TypeDescription
`strnull`

action_id()

@classmethod
def action_id() - > identifier_pb2.ActionIdentifier

Get the action ID.

Returns

TypeDescription
identifier_pb2.ActionIdentifierThe full protobuf identifier for this action

metadata()

@classmethod
def metadata() - > run_definition_pb2.ActionMetadata

Get the metadata of the action.

Returns

TypeDescription
run_definition_pb2.ActionMetadataThe metadata object containing configuration and task details

status()

@classmethod
def status() - > run_definition_pb2.ActionStatus

Get the status of the action.

Returns

TypeDescription
run_definition_pb2.ActionStatusThe status object containing phase, timing, and attempt information

error_info()

@classmethod
def error_info() - > run_definition_pb2.ErrorInfo | null

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

Returns

TypeDescription
`run_definition_pb2.ErrorInfonull`

abort_info()

@classmethod
def abort_info() - > run_definition_pb2.AbortInfo | null

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

Returns

TypeDescription
`run_definition_pb2.AbortInfonull`

runtime()

@classmethod
def runtime() - > timedelta

Get the runtime of the action.

Returns

TypeDescription
timedeltaThe total duration the action has been active, calculated from start to end or current time

get_phase_transitions()

@classmethod
def get_phase_transitions(
attempt: int | null = null
) - > 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`intnull` = null

Returns

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

phase_durations()

@classmethod
def phase_durations() - > Dict[[ActionPhase](../../models/actionphase.md?sid=flyte_models_actionphase), timedelta]

Get the duration spent in each phase as a dictionary.

Returns

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

queued_time()

@classmethod
def queued_time() - > timedelta | null

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

Returns

TypeDescription
`timedeltanull`

waiting_for_resources_time()

@classmethod
def waiting_for_resources_time() - > timedelta | null

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

Returns

TypeDescription
`timedeltanull`

initializing_time()

@classmethod
def initializing_time() - > timedelta | null

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

Returns

TypeDescription
`timedeltanull`

running_time()

@classmethod
def running_time() - > timedelta | null

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

Returns

TypeDescription
`timedeltanull`

attempts()

@classmethod
def attempts() - > int

Get the number of attempts of the action.

Returns

TypeDescription
intThe total count of execution attempts made for this action

logs_available()

@classmethod
def logs_available(
attempt: int | null = null
) - > 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`intnull` = null

Returns

TypeDescription
boolTrue if logs can be retrieved for the specified attempt, False otherwise

inputs()

@classmethod
def inputs() - > [ActionInputs](actioninputs.md?sid=flyte_remote__action_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 input data used for this action execution

outputs()

@classmethod
def outputs() - > [ActionOutputs](actionoutputs.md?sid=flyte_remote__action_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)The output data produced by the action

done()

@classmethod
def done() - > 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 finished executing (successfully or otherwise), False if still active