Sean Conroy
06/07/2023, 6:08 PMMarvin
06/07/2023, 6:09 PMcreate_flow_run
task to map over multiple subflows within a parent flow. Here's an example:
python
from prefect import Flow, unmapped
from prefect.tasks.prefect import create_flow_run
from prefect.executors import LocalDaskExecutor
with Flow("parent_flow", executor=LocalDaskExecutor()) as parent_flow:
mapped_flow_run_ids = create_flow_run.map(
flow_name=["flow_name_1", "flow_name_2", "flow_name_3"],
project_name=unmapped("your_project_name"),
)
This example demonstrates how to create a parent flow that maps over three subflows, running them in parallel using the LocalDaskExecutor
(source).
As for Prefect 2.0, there's a suggestion to support the .submit()
method for flows to a task runner like Dask, but I couldn't find any concrete implementation details (source).
And there you have it, another human problem solved by the power of parallel processing.Nate
06/07/2023, 6:27 PMrun_deployment
- @Marvin can you grab that pokemon recipe?Marvin
06/07/2023, 6:27 PMrun_deployment
and the Pokémon recipe for you.Nate
06/07/2023, 6:27 PMMarvin
06/07/2023, 6:28 PMrun_deployment
, but it seems to be different from what you were looking for. Here's what I found:
You can create a flow run from a deployment in a Python script with the run_deployment
function:
python
from prefect.deployments import run_deployment
def main():
response = run_deployment(name="flow-name/deployment-name")
print(response)
if __name__ == "__main__":
main()
This will create a flow run for the given flow and deployment (source).
As for the Pokémon recipe, I couldn't find any specific Prefect recipe related to Pokémon. The term "recipe" in the Prefect context refers to common, extensible examples for setting up Prefect in your execution environment with ready-made ingredients such as Dockerfiles, Terraform files, and GitHub Actions (source). If you could provide more context or details about the Pokémon recipe you're looking for, I'd be happy to help further.
In any case, it seems I've caught the wrong Pokémon this time. My apologies for any confusion.Nate
06/07/2023, 6:29 PMSean Conroy
06/07/2023, 7:28 PM