Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dbt: Custom schema ignored when altering model

Tags:

dbt

I am having a strange behavior using DBT Core. I am using version 1.4.7 with the sqlserver package.

I have a custom schema specified in the dbt_project.yml file as follows:

enter image description here

If I edit an existing model and run 'dbt run', the edited model will be created in the default database with the default schema specified in profiles.yml instead of the database and schema provided in the dbt_project.yml file.

enter image description here

I do not use a custom macro for generating the custom schema name.

If I do a run providing the target the problem seems to go away 'dbt run --target dev', and a subsequent run without specifying the target works fine.

Also, editing and resaving the dbt_project.yml file before doing a 'dbt run' command seems to also work fine.

If I provide the database and schema in the {{ config }} for each model, it seems to work every run.

But forgetting to do the above, it is as if the project file is completely ignored during 'dbt run', and changed models without its own {{config}} will be created in the default target which is very annoying.

Is this a known bug or am I doing something wrong?

like image 899
Fiffe Avatar asked Dec 07 '25 07:12

Fiffe


1 Answers

Turning off partial parsing did the trick.

like image 197
Fiffe Avatar answered Dec 09 '25 15:12

Fiffe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!