Hi <@ULVA73B9P>! I wish you a pleasant day, take c...
# ask-marvin
a
Hi @Marvin! I wish you a pleasant day, take care and keep it positive! Can you tell me how to override and disable results persistence and caching for all tasks and flows for test purposes?
m
To override and disable results persistence and caching for all tasks and flows in Prefect 3.x, you can adjust specific settings and configurations: 1. Disabling Results Persistence: By default, results are not persisted in Prefect, meaning no reference to them is maintained in the API. If you have enabled persistence, you can disable it by ensuring the
PREFECT_RESULTS_PERSIST_BY_DEFAULT
and
PREFECT_TASKS_DEFAULT_PERSIST_RESULT
settings are set to
False
. This will prevent any results from being stored. 2. Disabling Caching: To disable caching, you can avoid setting cache keys or use a custom cache key function that always returns a unique value, thus preventing cache hits. For more detailed information, you can refer to the Prefect documentation on results persistence and task caching. If you need to configure this programmatically, you can define your tasks and flows without specifying any caching or persistence configurations, relying on the default behavior that avoids persistence and caching. If you have any specific scenarios or configurations in mind, feel free to ask!
a
I am using prefect 2.0 and want do it globally with updating the code. Is there any variable?