Make it easy to manually query store for result records written on disk #17592
Unanswered
TheoMathurin
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Result records written on disk can be read by Prefect in the context of tasks where caching is enabled. For a more flexible use of cache in complex workflows, I'd like to find an easy way to directly retrieve results written by previous flow runs given that I know the keys used to store them.
I tried to use the store, through
get_result_store
, but it looks like only results that have been cached in memory in the current flow run can be accessed. Here is a basic example:The traceback when attempting to read from the store before calling the task is similar to this.
The reason is likely the same: in this context the store's
metadata_storage
isNullFilesystem
. If I setstore.metadata_storage
toNone
myself, then it works. I don't know if this can have adverse consequences in the overall behaviour of the caching mechanism though. Presumably havingNullFileSystem
in the flow context is intended behaviour (unlike a transaction context).As an aside, I noticed that if I set
cache_result_in_memory
toFalse
at flow-level, the store's LRU cache will nonetheless contain the result ofmy_task
, andstore.cache_result_in_memory
will automatically be changed toTrue
. When reading the docs, I thought that it meant disabling memory storage for all its tasks (given that there is no caching at flow-level). Setting it toFalse
at task-level does prevent it from being stored in memory.Beta Was this translation helpful? Give feedback.
All reactions