Hi all! We're using Prefect version 0.14.17 and ha...
# prefect-community
f
Hi all! We're using Prefect version 0.14.17 and have an issue with running a flow from within another in a python script. I used the following from the docs:
Copy code
from 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!
k
create_flow_run
is 0.15.0 and up. That version has
StartFlowRun
though
f
Hi Kevin! What is the import path or documentation?
m
Good question. https://docs.prefect.io/orchestration/flow-runs/creation.html#task says:
from 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
k
It’s equivalent because the init file of
prefect.tasks.prefect
imports it. The import in the original snippet is right. It’s just your Prefect version is too low Fredrick
f
Thanks @Kevin Kho the issue of low Prefect version will be rectified shortly.