I have written a dbt model which consists of good number of columns. Since I am only tweaking few columns, I made use of dbt_utils.star()
macro to select the rest of the columns which makes the code concise:
{{
dbt_utils.star(
from=this, except=["COL1"], relation_alias="tgt"
)
}}
The problem is that when I run the model very first time (when it doesn’t exist in the warehouse), it fails because it will not find any metadata for the model in the target warehouse. What I’m trying to achieve is to be able to create the model in the initial run while still be able to use a one-liner like dbt_utils.star()
macro for selecting columns to keep code concise. Is it possible? Any suggestions would be appreciated.