dbt seed error with schema config

I am trying to seed a small csv file in Redshift with the schema element in my config. I need to write this seed to a schema that is not the target schema. I would prefer to specify this configuration in the properties.yml file (not in the project file).

I have upgraded to the most recent version of dbt-core (1.8.6), dbt-postgres (1.8.2) and dbt-redshift (1.8.1). I have tried running a similar create table command in an editor with my db user (same user for dbt) against the schema I’m specifying in config, and it works just fine. So, this isn’t a version or permission issue.

Here is my properties.yml file:

version: 2

seeds:
  - name: my_sd__table
    description: This is my seed table
    config:
      enabled: true
      schema: my_custom_schema

When I run the above, I get the below error message. When I run the above without schema (i.e. it writes to my target schema), it works.

02:56:35  Finished running  in 0 hours 0 minutes and 3.22 seconds (3.22s).
02:56:35  Encountered an error:
Database Error
  zero-length delimited identifier at or near """" in context "schema if not exists """, at line 2, column 29

What am I doing wrong?

Turns out, my custom generate_schema_name() was not propagating the schema name correctly. The seed started copying into the configured schema properly after I adjusted the macro.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.