hi there! does anybody have experience with how to...
# ask-community
l
hi there! does anybody have experience with how to implement a pyhton/prefect run into a dbt workflow, so that some of the tables are running before and some after that python job?
1
k
Hey @Laura Vaida, I have just gotten the DBT task working. Do you mean you have a dbt job followed by a Python job followed by another dbt job?
l
yes exactly :)
but orchestrating for dbt runs should be still via dbt
k
I haven’t done this myself, but wouldn’t it be the DbtShellTask followed by your Python tasks followed by another DbtShellTask? Or is the issue that the DbtShellTask runs all the Dbt stuff at the same time?
l
well the thing is, i already use a dbt job managed by dbt cloud, but now i want to integrate a python task into that. meaning there would be kind of a break to do that python run managed by prefect and afterward dbt run should go on
k
Got it. I think what needs to happen here is that Prefect is a macro-level orchestration that also handles starting those dbt jobs. You would need to use the dbt Cloud API to create those jobs as a Prefect task. Then Prefect can do the Python stuff between the dbt Cloud jobs.
l
okey thanks 🙂