Auto-materialization for dbt views using code version #18035
-
I'm wondering if it would be possible to build auto-materialize rules so that a a dbt view asset will only update if it's code version has changed. As it stands, with an "eager" policy, every view will update anytime an upstream asset updates. However, if the view code has not changed, it's actually unnecessary to run a materialization, as it's not producing any changes to the data model. This results in Dagster doing a bunch of extra work and a busier server, which has real costs if your running it in a kubernetes cluster. It would be great if we could specify that view models should be passed over if there has been no code change when evaluated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
This is not currently possible, but here's the issue where we're tracking the ability to auto-materialize when there's a code change: #15686. Once we add that auto-materialize rule, then you'll be able to get the behavior you're looking for by creating an auto-materialize policy without the |
Beta Was this translation helpful? Give feedback.
-
This is now possible using the Declarative Automation. You can set the You can accomplish this by updating the |
Beta Was this translation helpful? Give feedback.
This is now possible using the Declarative Automation. You can set the
automation_condition
for your dbt views toAutomationCondition.code_version_changed()
to have them only materialize when a code version change is detected.You can accomplish this by updating the
get_automation_condition()
method on yourDagsterDbtTranslator
to return this condition for dbt models which are views.