flytekit.TaskMetadata#

class flytekit.TaskMetadata(cache=False, cache_serialize=False, cache_version='', cache_ignore_input_vars=(), interruptible=None, deprecated='', retries=0, timeout=None, pod_template_name=None, generates_deck=False, is_eager=False)[source]#

Metadata for a Task. Things like retries and whether or not caching is turned on, and cache version are specified here.

See the IDL for the protobuf definition.

Parameters:
  • cache (bool)

  • cache_serialize (bool)

  • cache_version (str)

  • cache_ignore_input_vars (Tuple[str, ...])

  • interruptible (bool | None)

  • deprecated (str)

  • retries (int)

  • timeout (timedelta | int | None)

  • pod_template_name (str | None)

  • generates_deck (bool)

  • is_eager (bool)

cache#

Indicates if caching should be enabled. See Caching.

Type:

bool

cache_serialize#

Indicates if identical (i.e. same inputs) instances of this task should be executed in serial when caching is enabled. See Caching.

Type:

bool

cache_version#

Version to be used for the cached value.

Type:

str

cache_ignore_input_vars#

Input variables that should not be included when calculating hash for cache.

Type:

Tuple[str, …]

interruptible#

Indicates that this task can be interrupted and/or scheduled on nodes with lower QoS guarantees that can include pre-emption.

Type:

Optional[bool]

deprecated#

Can be used to provide a warning message for a deprecated task. An absence or empty string indicates that the task is active and not deprecated.

Type:

str

retries#

for retries=n; n > 0, on failures of this task, the task will be retried at-least n number of times.

Type:

int

timeout#

The maximum duration for which one execution of this task should run. The execution will be terminated if the runtime exceeds this timeout.

Type:

Optional[Union[datetime.timedelta, int]]

pod_template_name#

The name of an existing PodTemplate resource in the cluster which will be used for this task.

Type:

Optional[str]

generates_deck#

Indicates whether the task will generate a Deck URI.

Type:

bool

is_eager#

Indicates whether the task should be treated as eager.

Type:

bool

Methods

to_taskmetadata_model()[source]#

Converts to _task_model.TaskMetadata

Return type:

TaskMetadata

Attributes

cache: bool = False
cache_ignore_input_vars: Tuple[str, ...] = ()
cache_serialize: bool = False
cache_version: str = ''
deprecated: str = ''
generates_deck: bool = False
interruptible: bool | None = None
is_eager: bool = False
pod_template_name: str | None = None
retries: int = 0
retry_strategy
timeout: timedelta | int | None = None