Open OFlanagan opened 7 months ago
@dbeatty10 FYI
I suspect that the noop_statement
called for the seed materialization here isn't including query comments for some reason.
However, regular statement
does include the query comments via adapter.execute
.
Create this seed file:
seeds/my_seed.csv
id
1
Run these commands:
dbt clean
dbt seed --full-refresh
Open logs/dbt.log
.
See that query comments are applied to the CTAS:
13:07:57.639380 [debug] [Thread-1 (]: On seed.my_project.my_seed: /* {"app": "dbt", "dbt_version": "1.7.8", "profile_name": "postgres", "target_name": "postgres", "node_id": "seed.my_project.my_seed"} */
create table "postgres"."dbt_dbeatty"."my_seed" ("id" integer)
But see that they are missing for the insert statement:
[0m13:07:57.660162 [debug] [Thread-1 (]: On seed.my_project.my_seed:
insert into "postgres"."dbt_dbeatty"."my_seed" ("id") values
(%s)
...
Is this a new bug in dbt-core?
Current Behavior
Queries run against redshift do not all have the query-comment appended at the start. This query-comment is present for many CREATE and DELETE commands but is missing for inserts for seeds (the insert does not have query comments)
Expected Behavior
the documentation states "A string to inject as a comment in each query that dbt runs against your database" This means that the above inserts should also include the query-comment https://docs.getdbt.com/reference/project-configs/query-comment
Steps To Reproduce
define a seed in your dbt project ensure query-comments are enabled for your project run dbt run --select seed_name
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
redshift
Additional Context
Spun off of https://github.com/dbt-labs/dbt-core/issues/9617