Today, Javier from Wayflyer asked about using ZenML And DBT together on Slack. Got me thinking: That seems like quite something that might be useful to many people.
Why use DBT and ZenML together?
ZenML is used for ML workflows, while DBT is used for data transformations. This goes hand in hand when you have use cases like:
- Running a data transformation after training a model
- Doing post-batch-inference data transformations (That’s Javier’s use case)
- Triggering a training/inference/deployment ML workflow after a data transformation is complete
How I’d do it
My suggestion to Javier was to do the transformation as a ZenML success hook:
The above code simply triggers a GitHub action in a repo where you have the DBT code. As DBT supports function invocation now (as Javier notes) , you could then have a github action that triggers the dbt transformation:
That’s it - You’ve hooked up your ML pipelines with your dbt transformations.
So what?
Establishing a link between the modern data stack and the MLOps world is a challenge. Data and ML people often think differently and want to use their own tools for their daily work. Having more well defined interfaces between the worlds might lead to better outcomes overall.
The above is just an example and is an interesting place to start. Let me know if you do try it - and share your thoughts on the use-case in general over on Slack.