Nejc Vesel
10/08/2020, 9:11 AMfrom prefect.utilities.configuration import set_temporary_config
def test_prefect(input_folder, output_folder):
with set_temporary_config({"home_dir": output_folder}):
exec_config = ExecutionConfig(dataset_location=os.path.join(get_path('parquet'), 'pq-dataset'),
save_location=os.path.join(output_folder, 'mean_ndvi_results'))
status = flow.run(executor=LocalExecutor(), flow_config=asdict(exec_config))
assert status.is_successful()
(took a look at some tests in the prefect source), but it doesnt work at still writes LocalResult results to ~/.prefectChris White
LocalResult
itself to use your test directory. The LocalResult
accepts a dir
keyword at initialization that allows you to specify alternate directoriesNejc Vesel
10/09/2020, 6:13 AM@task(target="{flow_run_name}/chunk/{map_index}.json", checkpoint=True, log_stdout=True, result=RESULT)
def do_something() -> str:
return chunk_id
How can I make the test so the default target location is not ~/.prefect but a specified test folder. Thank you so much for the help.
Best,
Nejc