Seed data column type changes aren't being applied

I followed the instructions described in Seed configurations | dbt Docs to customize a couple of columns’ data type, but seems dbt did pick up the config, but did nothing, column types were still inferred wrong. Is this a known issue or is there a better way to do this? Thanks

Hi,

This does work, I do it for some RegionCode seed data we use. In the dbt_project.yml file:

seeds:
  schema: STATIC_DATA
  {my_project_name}:
    regions:
      alias: region_codes
      +column_types:
        RegionCode: varchar(16)
        Description: varchar(255)

Resulting log entries when a dbt seed is run:

2021-07-08T07:27:08.370458Z: On seed.{my_project_name}.regions: /* executed by dbt cloud */

    create table DEMO_DB.dbt_dbeaty_STATIC_DATA.region_codes (RegionCode varchar(16),Description varchar(255))
2021-07-08T07:27:08.654076Z: SQL status: SUCCESS 1 in 0.28 seconds

Thank you for the response! Could you share your seed data file path? Does the file path have to be strictly reflected in the configuration nested hierarchy?

I think I found the problem, I ran once and the data type and table already there. I need to drop the schema to start from scratch. Now it works.

You’re right - dbt truncates and re-inserts into the table during a dbt seed step. You can use the --full-refresh flag to force it to drop your seed table, which saves you from having to manually drop it: full_refresh | dbt Developer Hub

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