Frederick Thomas
06/01/2022, 5:32 PMfrom prefect import Flow
from prefect.tasks.prefect import create_flow_run, wait_for_flow_run
with Flow("parent-flow") as flow:
# Create the child flow run, look up the flow by name
child_run_id = create_flow_run(flow_name="gotta-run-flow")
and got this:
ImportError: cannot import name 'create_flow_run' from 'prefect.tasks.prefect' (/usr/local/lib/python3.8/site-packages/prefect/tasks/prefect/__init__.py)
Could someone please assist? Thanks!Kevin Kho
06/01/2022, 5:35 PMcreate_flow_run
is 0.15.0 and up. That version has StartFlowRun
thoughFrederick Thomas
06/01/2022, 5:39 PMMartin T
06/01/2022, 5:52 PMfrom prefect.tasks.prefect import create_flow_run
while https://docs.prefect.io/api/latest/tasks/prefect.html#create-flow-run says:
from prefect.tasks.prefect.flow_run import create_flow_run
Kevin Kho
06/01/2022, 6:17 PMprefect.tasks.prefect
imports it. The import in the original snippet is right. It’s just your Prefect version is too low FredrickFrederick Thomas
06/01/2022, 7:19 PM