<#2912 initial make auto cache plugin> Pull reques...
# flyte-github
c
#2912 initial make auto cache plugin Pull request opened by dansola on <!date^1730939175^{date_short}|2024-11-07T00:26:15Z> Why are the changes needed? Make caching easier to use in flytekit by reducing cognitive burden of specifying cache versions What changes were proposed in this pull request?
AutoCache
protocol added to flytekit with a
salt
argument and a
get_version
method. The task function is passed to
get_version
in the task decorator to determine a cache version. Then the new cache version follows the same path a user created cache version would.
auto_cache
plugin created which will contain implementations of
AutoCache
. The first one is
CacheFunctionBody
which just checks the function body and ignores formatting and comments. How was this patch tested? Unit tests added which verify versions are consistent and change when we expect. Since changes to the function name will cause a different hash, we move dummy functions to a separate directory and import them so we can keep the name the same but test that the hash changes with the contents change. Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Docs link flyteorg/flytekit