Any suggestions on how to invalidate the cache whe...
# ask-the-community
g
Any suggestions on how to invalidate the cache when running a map task? Seeing this bug where tasks complete immediately even though I've tried: 1. disabling caching by setting
cache=False
on the mapped task 2. bumping the cache version from "0.1" to "0.2" on the mapped task
j
Can you register a new version and run ?
k
Use experimental.map_task
g
I tried a new version, that didn't work. Ended up breaking one of the tasks in my workflow into two (needed to do that anyway) so that seemed to invalidate the cache.
Ketan, I was having an issue with map_task that could only be resolved by wrapping it in a dynamic task.
Copy code
@task
def t(a: int) -> int:
    return a + 1
    
@dynamic
def t_wrapper(xs: List[int]) -> None:
    map_task(t)(a=xs)

@workflow
def experimental_map_task(xs: List[int]) -> None:
    t_wrapper(xs=xs)
s
What's the error you're seeing, @Gopal Vashishtha?
g
If I don't do that strange wrapper thing, then when I try to register the task I get:
Copy code
Error 0: Code: ParameterNotBound, Node Id: end-node, Description: Parameter not bound [o0]. Error 1: Code: ValueRequired, Node Id: n2, Description: Value required [Target]. Error 2: Code: ValueRequired, Node Id: n3, Description: Value required [Target]. Error 3: Code: VariableNameNotFound, Node Id: n2, Description: Variable [o0] not found on node [n2]
s
Are all your flyte components updated to 1.9.1?
g
I'm using flytekit 1.9.0
s
1.9.0 should work as well. @Dan Rammer (hamersaw), what could be the cause of this error?
d
will get to looking into this - seems to potentially be a flytekit issue where the dynamic is executed with a different version?!
k
This is the same question Tom is also asking
d
and others
k
I can help from flytekit side
d
@Gopal Vashishtha how are you registering this? flytectl?
k
@Dan Rammer (hamersaw) is this the same problem as hashing? If not can you share an example I can help
g
ended up just passing a nonce to the task as an input to overwrite cache. Yes registering with
flytectl register
k
Ohh is this the same as the older version of admin
d
> Ohh is this the same as the older version of admin Yes, @Gopal Vashishtha for some context - https://flyte-org.slack.com/archives/CP2HDHKE1/p1697574227413249?thread_ts=1696568069.202449&cid=CP2HDHKE1. TL;DR the 1.10 release will support ArrayNode.