Pedro Machado

    Pedro Machado

    1 year ago
    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.
    @task(
        target="ftp_{start_date}_{end_date}.done",
        result=LocalResult(dir=prefect.context.local_results_dir),
    )
    def mytask(start_date, end_date):
        pass
    Chris White

    Chris White

    1 year ago
    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)
    Pedro Machado

    Pedro Machado

    1 year ago
    Great thanks!