where are your tasks running?
depending on your infra, seems like you could either use a global s3_client var, or pass the same client to each of the tasks?
l
Lior Barak
09/26/2023, 3:48 PM
running in local hosted agent (pod on kubernetes over aws)
when passing an s3 client as a parameter I got a pydantic validation error
assumed you are only supposed to pass basic pydantic types that can be validated
n
Nicholas Torba
09/26/2023, 5:17 PM
does setting the s3_client type from s3 as the type hint in the task func help or it still fails (disclaimer: i don't work at prefect, just use it a fair amount and happened to be on slack this morning and see this)
🙂 1
l
Lior Barak
09/26/2023, 5:20 PM
will give that a shot tomorrow and see
Lior Barak
09/27/2023, 9:05 AM
so here is my solution:
looks like flows don't accept arbitrary types but tasks do
so just initialised s3 clients on flow level instead of task level
did some creative rearranging so to make it work