https://flyte.org logo
Title
h

honnix

11/17/2022, 7:53 PM
A quick question. I have a task with cache enabled, is there a way to disable cache when running under pytest (it’s effectively a local execution)?
OK I can do the following:
log_data.metadata.cache = False
    result = log_data(data="foo", storage_object_name="fizz", output_uri="<gs://buzz>")
It works but seems hacky.
j

Jay Ganbat

11/18/2022, 12:23 AM
yeah we have this fixture
@pytest.fixture(autouse=True)
def clear_local_cache() -> None:
    LocalTaskCache.clear()
this should clear your local cahce
h

honnix

11/18/2022, 5:48 AM
That looks better! Thank you.