Is it possible to set the `dir` for a `LocalResult...
# prefect-community
p
Is it possible to set the
dir
for a
LocalResult
at run time? I am setting it based on a context variable but it seems to be getting the value of the variable at registration time.
Copy code
@task(
    target="ftp_{start_date}_{end_date}.done",
    result=LocalResult(dir=prefect.context.local_results_dir),
)
def mytask(start_date, end_date):
    pass
c
Hi Pedro, yes you can achieve this by: 1) setting dir = None 2.) using an absolute path in your target (which can be templated with variables from context)
p
Great thanks!