https://prefect.io logo
s

Suresh R

01/20/2022, 7:01 AM
Hi, How i can store all task result of flow in specific S3 prefix?
k

Kevin Kho

01/20/2022, 7:04 AM
The flow location needs to be defined at registration time or templated to be filled at runtime. If you know the prefix at registration time, you can just add it to the string you set. If you need it at runtime, i think you need to do it through a Parameter as shown here
s

Suresh R

01/20/2022, 7:05 AM
Shall i pass same location to all tasks?
Will prefect use some uuid in filename to differentiate it, or it will overwrite in whatever location i provide?
k

Kevin Kho

01/20/2022, 7:10 AM
If you provide the same location to all tasks, it will overwrite. It won’t differentiate, but you can add the
task_run_id
if you want
s

Suresh R

01/20/2022, 7:12 AM
Can you share the template for adding task_run_id
k

Kevin Kho

01/20/2022, 7:15 AM
In the example here , replace with
Copy code
@task(result=LocalResult(location="{task_run_id}.prefect"))
def downstream_task(x):
    return [i * 10 for i in x]
Note this is not an f-string. It’s a normal string
s

Suresh R

01/20/2022, 7:19 AM
ok Thanks
4 Views