TaskDetails
This class provides a detailed representation of a remote task, allowing users to retrieve, inspect, and override task configurations. It supports fetching task metadata by name and version, managing execution interfaces, and defining resource requirements or cache policies. Additionally, it enables remote task execution by forwarding calls to a backend controller within a task context.
Attributes
| Attribute | Type | Description |
|---|---|---|
| pb2 | task_definition_pb2.TaskDetails | The underlying protobuf message containing the task definition and metadata. |
| max_inline_io_bytes | int = 10485760 | The maximum size in bytes for input/output data to be handled inline rather than via external storage. |
| overriden_queue | Optional[str] = null | The name of the specific execution queue to use for this task, bypassing the default queue if set. |
Constructor
Signature
def TaskDetails(
pb2: task_definition_pb2.TaskDetails,
max_inline_io_bytes: int = 10485760,
overriden_queue: Optional[str] = None
)
Parameters
| Name | Type | Description |
|---|---|---|
| pb2 | task_definition_pb2.TaskDetails | The protobuf representation of the task details. |
| max_inline_io_bytes | int = 10485760 | The maximum size in bytes for inline input/output data. |
| overriden_queue | Optional[str] = None | An optional string to override the default execution queue. |
Methods
get()
@classmethod
def get(
name: str,
project: str | None,
domain: str | None,
version: str | None = None,
auto_version: AutoVersioning | None = None
) - > LazyEntity
Get a task by its ID or name. If both are provided, the ID will take precedence.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The name of the task. |
| project | `str | None` |
| domain | `str | None` |
| version | `str | None` = None |
| auto_version | `AutoVersioning | None` = None |
Returns
| Type | Description |
|---|---|
LazyEntity | A lazy entity that will fetch the task details when accessed or awaited. |
fetch()
@classmethod
def fetch(
name: str,
project: str | None = None,
domain: str | None = None,
version: str | None = None,
auto_version: AutoVersioning | None = None
) - > [TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails)
Fetches the task details from the remote service immediately using the provided identification parameters.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The name of the task to fetch. |
| project | `str | None` = None |
| domain | `str | None` = None |
| version | `str | None` = None |
| auto_version | `AutoVersioning | None` = None |
Returns
| Type | Description |
|---|---|
[TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails) | The fully populated task details object. |
name()
@classmethod
def name() - > str
The name of the task.
Returns
| Type | Description |
|---|---|
str | The unique identifier name of the task. |
version()
@classmethod
def version() - > str
The version of the task.
Returns
| Type | Description |
|---|---|
str | The specific version string of the task. |
task_type()
@classmethod
def task_type() - > str
The type of the task.
Returns
| Type | Description |
|---|---|
str | The string representation of the task type (e.g., python-task, container-task). |
default_input_args()
@classmethod
def default_input_args() - > Tuple[str, ...]
The default input arguments of the task.
Returns
| Type | Description |
|---|---|
Tuple[str, ...] | A tuple containing the names of input arguments that have default values defined. |
required_args()
@classmethod
def required_args() - > Tuple[str, ...]
The required input arguments of the task.
Returns
| Type | Description |
|---|---|
Tuple[str, ...] | A tuple of input argument names that must be provided by the caller. |
interface()
@classmethod
def interface() - > [NativeInterface](../../models/nativeinterface.md?sid=flyte_models_nativeinterface)
The interface of the task.
Returns
| Type | Description |
|---|---|
[NativeInterface](../../models/nativeinterface.md?sid=flyte_models_nativeinterface) | The typed interface defining the inputs and outputs of the task. |
cache()
@classmethod
def cache() - > flyte.Cache
The cache policy of the task.
Returns
| Type | Description |
|---|---|
flyte.Cache | The caching configuration including behavior, version, and ignored inputs. |
secrets()
@classmethod
def secrets() - > List[str]
Get the list of secret keys required by the task.
Returns
| Type | Description |
|---|---|
List[str] | A list of keys representing the secrets the task needs access to. |
resources()
@classmethod
def resources() - > Tuple
Get the resource requests and limits for the task as a tuple (requests, limits).
Returns
| Type | Description |
|---|---|
Tuple | A tuple containing the resource requests and limits defined for the task container. |
queue()
@classmethod
def queue() - > Optional[str]
Get the queue name to use for task execution, if overridden.
Returns
| Type | Description |
|---|---|
Optional[str] | The name of the specific execution queue, or None if the default is used. |
override()
@classmethod
def override(
short_name: Optional[str],
resources: Optional[flyte.Resources],
retries: Union[int, flyte.RetryStrategy],
timeout: Optional[flyte.TimeoutType],
env_vars: Optional[Dict[str, str]],
secrets: Optional[flyte.SecretRequest],
max_inline_io_bytes: Optional[int],
cache: Optional[flyte.Cache],
queue: Optional[str]
) - > [TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails)
Create a new TaskDetails with overridden properties.
Parameters
| Name | Type | Description |
|---|---|---|
| short_name | Optional[str] | Optional short name for the task. |
| resources | Optional[flyte.Resources] | Optional resource requirements. |
| retries | Union[int, flyte.RetryStrategy] | Number of retries or retry strategy. |
| timeout | Optional[flyte.TimeoutType] | Execution timeout. |
| env_vars | Optional[Dict[str, str]] | Environment variables to set. |
| secrets | Optional[flyte.SecretRequest] | Secret requests for the task. |
| max_inline_io_bytes | Optional[int] | Maximum inline I/O size in bytes. |
| cache | Optional[flyte.Cache] | Cache configuration. |
| queue | Optional[str] | Queue name for task execution. |
Returns
| Type | Description |
|---|---|
[TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails) | A new TaskDetails instance with the overrides applied. |