<#4330 [BUG] Caching does not work correctly for p...
# flyte-github
a
#4330 [BUG] Caching does not work correctly for partials Issue created by hamersaw Describe the bug When running the example:
Copy code
from flytekit import task, workflow, map_task
import typing
import functools

@task(cache=True, cache_version="0.1")
def t1(x: int, y: int) -> int:
   return x + y

@workflow
def wf_cached(data: typing.List[int]):
   p = functools.partial(t1, y=0)
   x = map_task(p)(x=data)

   q = functools.partial(t1, y=1)
   y = map_task(q)(x=data)
The first execution works as expected, node
n0
has output
[0,1]
and node
n1
has output
[1,2]
because both are started simultaneously. However, the second execution both nodes read from cache and result in output
[0,1]
. This is likely an issue with computing the cache key for partial functions. Expected behavior Caching should work with partials. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte