Skip to main content

TaskDetails

No overview available.

Attributes

AttributeTypeDescription
pb2task_definition_pb2.TaskDetailsThis attribute stores the protobuf representation of the task details, which is used to access various properties of the task.
max_inline_io_bytesint = 10485760This attribute specifies the maximum number of bytes for inline I/O operations, affecting how large data can be passed directly within the task execution context.
overriden_queueOptional[str] = NoneThis attribute stores an optional string representing the name of the queue to use for task execution, allowing the task to be routed to a specific 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. Either version or auto_version are required parameters.

Parameters

NameTypeDescription
namestrThe name of the task.
project`strNone`
domain`strNone`
version`strNone` = None
auto_version`AutoVersioningNone` = None

Returns

TypeDescription
LazyEntity

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 TaskDetails for a given task, project, domain, and version, or automatically determines the version. This method is asynchronous and returns the fully resolved TaskDetails object.

Parameters

NameTypeDescription
namestrThe name of the task to fetch.
project`strNone` = None
domain`strNone` = None
version`strNone` = None
auto_version`AutoVersioningNone` = None

Returns

TypeDescription
[TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails)The fetched TaskDetails object.

name()

@classmethod
def name() - > str

The name of the task.

Returns

TypeDescription
str

version()

@classmethod
def version() - > str

The version of the task.

Returns

TypeDescription
str

task_type()

@classmethod
def task_type() - > str

The type of the task.

Returns

TypeDescription
str

default_input_args()

@classmethod
def default_input_args() - > Tuple[str, ...]

The default input arguments of the task.

Returns

TypeDescription
Tuple[str, ...]

required_args()

@classmethod
def required_args() - > Tuple[str, ...]

The required input arguments of the task.

Returns

TypeDescription
Tuple[str, ...]

interface()

@classmethod
def interface() - > [NativeInterface](../../models/nativeinterface.md?sid=flyte_models_nativeinterface)

The interface of the task.

Returns

TypeDescription
[NativeInterface](../../models/nativeinterface.md?sid=flyte_models_nativeinterface)

cache()

@classmethod
def cache() - > flyte.Cache

The cache policy of the task.

Returns

TypeDescription
flyte.Cache

secrets()

@classmethod
def secrets()

Get the list of secret keys required by the task.

Returns

TypeDescription
A list of secret keys (strings) that the task requires for execution.

resources()

@classmethod
def resources()

Get the resource requests and limits for the task as a tuple (requests, limits).

Returns

TypeDescription
A tuple containing the resource requests and limits for the task's container. Returns an empty tuple if no container is defined.

queue()

@classmethod
def queue() - > Optional[str]

Get the queue name to use for task execution, if overridden.

Returns

TypeDescription
Optional[str]

override()

@classmethod
def override(
short_name: Optional[str] = None,
resources: Optional[flyte.Resources] = None,
retries: Union[int, flyte.RetryStrategy] = 0,
timeout: Optional[flyte.TimeoutType] = None,
env_vars: Optional[Dict[str, str]] = None,
secrets: Optional[flyte.SecretRequest] = None,
max_inline_io_bytes: Optional[int] = None,
cache: Optional[flyte.Cache] = None,
queue: Optional[str] = None,
kwargs: Any
) - > [TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails)

Create a new TaskDetails with overridden properties.

Parameters

NameTypeDescription
short_nameOptional[str] = NoneOptional short name for the task.
resourcesOptional[flyte.Resources] = NoneOptional resource requirements.
retriesUnion[int, flyte.RetryStrategy] = 0Number of retries or retry strategy.
timeoutOptional[flyte.TimeoutType] = NoneExecution timeout.
env_varsOptional[Dict[str, str]] = NoneEnvironment variables to set.
secretsOptional[flyte.SecretRequest] = NoneSecret requests for the task.
max_inline_io_bytesOptional[int] = NoneMaximum inline I/O size in bytes.
cacheOptional[flyte.Cache] = NoneCache configuration.
queueOptional[str] = NoneQueue name for task execution.
kwargsAnyAdditional keyword arguments. Remote tasks do not support overriding with arbitrary kwargs.

Returns

TypeDescription
[TaskDetails](taskdetails.md?sid=flyte_remote__task_taskdetails)A new TaskDetails instance with the overrides applied.