acoustic-carpenter-78188
10/30/2023, 8:40 PMfrom 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/flyteacoustic-carpenter-78188
11/06/2023, 2:45 PM