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
Kevin Kho
07/20/2021, 3:14 PM
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
Laura Vaida
07/20/2021, 3:15 PM
yes exactly :)
Laura Vaida
07/20/2021, 3:16 PM
but orchestrating for dbt runs should be still via dbt
k
Kevin Kho
07/20/2021, 3:17 PM
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
Laura Vaida
07/20/2021, 3:18 PM
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
Kevin Kho
07/20/2021, 3:28 PM
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.