Hi all, A couple of questions: 1. Anyone could po...
# prefect-community
m
Hi all, A couple of questions: 1. Anyone could point me to what is the functionality in prefect 2.0 that does the same as
@task(LocalResult(dir='path/to/folder/for/storage),target='result.pkl',checkpoint=True)
2. In prefect 1.0, if a task returns a dictionary and I specify as above how to locally cache why may be getting that
result.pkl
only saves the last element in the dictionry? Thanks,
1
s
m
I was reading that documentation, but I am bit confused by the cache keys. It seems like they rely in the task input rather than if the resulting file exists or not.
z
You could write a custom cache key function that checks for the presence of a file
There’s just not one out of the box right now
m
Are there examples out there?
I see, and then how should I pass that to the @task decorator?
For anyone else interested, I ended up writing my own custom cache key function. I will be creating a public repo on my GitHub for anyone else that wants this functionality. Would be great if prefect could implement it in the package itself.
🙌 2