user49300
user49300

Reputation: 31

Dbt: Adding query-comment in dbt_project.yml does not add query comments in compiled code

I've added in dbt_project.yml the following code:

query-comment:
    comment: 'run by {{ target.user }} in dbt'

but after running the models in the compiled code in the target folder I do not see the comment which is supposed to be there.

I've tried to test the query-comment and using dbt run or dbt compile but in the target folder I do not see the comment. I am using a local postgres database. Models all run successfully but without comments in the compiled SQL.

Upvotes: 2

Views: 1177

Answers (1)

bajafresh4life
bajafresh4life

Reputation: 12883

If you're using Snowflake, you'll need to add the append:true option. With this option, dbt will append the comment at the end of the query (Snowflake automatically removes any comments that are at the beginning of the query)

Upvotes: 0

Related Questions