Medium severitydata_quality
Power BI Refresh Error:
SeedColumnTypeMismatch
What does this error mean?
A dbt seed load failed because the inferred or configured column type for a seed file does not match the existing table column type in the database, causing the COPY or INSERT statement to fail with a type cast error.
Common causes
- 1A seed CSV column contains mixed values (e.g., integers and strings) that dbt infers as VARCHAR, but the existing seed table in the database still has the old INTEGER type from a previous run
- 2The column_types configuration in dbt_project.yml or the seed YAML specifies a type that is incompatible with the CSV data (e.g., DATE for a column that contains timezone-aware timestamps)
- 3The seed CSV was updated with a new column or a changed column format, but the existing seed table was not dropped and re-created with --full-refresh
How to fix it
- 1Step 1: Run dbt seed --full-refresh --select <seed_name> to drop and re-create the seed table with the updated schema inferred from the current CSV.
- 2Step 2: If the type is wrong due to inference, add an explicit column_types entry in the seed's YAML: column_types: {id: integer, created_at: timestamp}.
- 3Step 3: Check the CSV for mixed-type columns — a single non-numeric value in an otherwise numeric column will cause dbt to infer the entire column as string.
- 4Step 4: Run dbt seed after applying the fix to confirm the load succeeds.