flytekit.TaskMetadata

class flytekit.TaskMetadata(cache: bool = False, cache_version: str = '', interruptable: bool = False, deprecated: str = '', retries: int = 0, timeout: Optional[Union[datetime.timedelta, int]] = None)[source]

Create Metadata to be associated with this Task

Parameters
  • cache – Boolean that indicates if caching should be enabled

  • cache_version – Version string to be used for the cached value

  • interruptable – Boolean that indicates that this task can be interrupted and/or scheduled on nodes with lower QoS guarantees. This will directly reduce the $/execution cost associated, at the cost of performance penalties due to potential interruptions

  • deprecated – A string that can be used to provide a warning message for deprecated task. Absence / empty str indicates that the task is active and not deprecated

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

  • timeout – the max amount of time for which one execution of this task should be executed for. If the execution will be terminated if the runtime exceeds the given timeout (approximately)

__init__(cache: bool = False, cache_version: str = '', interruptable: bool = False, deprecated: str = '', retries: int = 0, timeout: Optional[Union[datetime.timedelta, int]] = None)None

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([cache, cache_version, …])

Initialize self.

to_taskmetadata_model()

Converts to _task_model.TaskMetadata

Attributes

cache

cache_version

deprecated

interruptable

retries

retry_strategy

timeout