https://prefect.io logo
Title
k

Kevin Grismore

10/18/2022, 10:23 PM
Let's say I want to use
run_deployment()
in a flow, and I want to run multiple deployments concurrently, then move on to the next task once all the deployments have finished running. How might I do that?
1
I tried using
anyio.create_task_group()
but when I provide the positional args to
run_deployment
in the call to
start_soon()
I get:
TypeError: run_deployment() got multiple values for argument 'client'
So I'm guessing that's probably not the way to do it.
z

Zanie

10/18/2022, 10:45 PM
Hm that should work, sounds like a bug or an unexpected calling pattern. Can you share an example?
You can use functools.partial to work around anyio not accepting keyword arguments, btw.
(A task group is indeed the correct pattern here, btw)
k

Kevin Grismore

10/18/2022, 10:46 PM
Was considering using functools.partial. Give me a moment to try it, and if it doesn't work, I'll share the code.
z

Zanie

10/18/2022, 10:49 PM
We automatically inject the client as a kwarg and if provided positionally it'll break.
k

Kevin Grismore

10/18/2022, 10:50 PM
of course! that was the fix
❤️