I have a question regarding passing `LocalResult()`s in a flow of flows while testing the parent flow. The pattern here (subflow result passing) makes sense, but it seems like its designed for when running in prod on Server or Cloud. Is there a way to fudge a
flow_id
for
get_task_run_result
when just calling
flow.run()
for testing, or should I be thinking about this in an entirely different way when testing?
k
Kevin Kho
08/18/2021, 12:31 AM
Hey @Adam Shamlian, unfortunately, I don’t think there is a way because these tasks are designed to interact with a backend. Some users spin up Prefect Server for local testing. Some people also use the
case
task as an if-else to separate local testing.
a
Adam Shamlian
08/18/2021, 12:38 AM
Thanks for the swift reply. I will probably use the case approach with a "magic" test-only method. This gets my gears turning about dependency injection in Prefect, which strikes me as a cool possibility (though I know DI isn't necessarily the go-to approach in python), particularly for environment level switching. Anyways, thanks again!
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.