Hello, we are using Snowflake and have a dbt proje...
# integration-dbt
t
Hello, we are using Snowflake and have a dbt project with models materialized as tables and views. We currently exclude views from our recurring jobs because : 1. Dbt does a replace of the views (drop + create) which has consequences like loosing object tags. 2. The views don't change between run, we would like to avoid the computation if possible. This means that our view assets will not be refreshed by Dagster and downstream assets will be shown as stale. This is not ideal and this is going to be an issue if we want to start using Freshness Policies. Any suggestion on how to avoid that issue ?
j
Hi @Timothee Vandeput would adding dbt post-hooks to apply snowflake object tagging to your views solve this issue? Using post-hooks will allow dbt to run custom sql statements after the models are materialized e.g.
alter view my_view set tag cost_center = 'sales';
That way you don't have to exclude the running of views because views can be drop and re-created, and the object tags applied to them using a post-hook.
t
Hello @Jonathan Neo, yes we are considering that option. We have one more challenge, object tagging will be done outside DBT. So we would have to read the tag with a pre-hook, update the view and apply the tags again.
👍 1
j
That makes sense. Out of curiosity, what is managing the object tagging if it sits outside of the code? Is it done through a data governance tool?
t
Yes we expect the data governance tool to set the tags on the objects (this is a work in progress).