flytekit.Cache#

class flytekit.Cache(version=None, serialize=False, ignored_inputs=(), salt='', policies=None)[source]#

Cache configuration for a task.

Parameters:
  • version (Optional[str]) – The version of the task. If not provided, the version will be generated based on the cache policies.

  • serialize (bool) – Boolean that indicates if identical (ie. same inputs) instances of this task should be executed in serial when caching is enabled. This means that given multiple concurrent executions over identical inputs, only a single instance executes and the rest wait to reuse the cached results.

  • ignored_inputs (Union[Tuple[str, ...], str]) – A tuple of input names to ignore when generating the version hash.

  • salt (str) – A salt used in the hash generation.

  • policies (Optional[Union[List[CachePolicy], CachePolicy]]) – A list of cache policies to generate the version hash.

Methods

get_ignored_inputs()[source]#
Return type:

Tuple[str, …]

get_version(params)[source]#
Parameters:

params (VersionParameters)

Return type:

str

Attributes

ignored_inputs: Tuple[str, ...] | str = ()
policies: List[CachePolicy] | CachePolicy | None = None
salt: str = ''
serialize: bool = False
version: str | None = None