Search code examples
google-bigquerymanifest.jsondbt

DBT manifest.json data type is null


I'm creating a lot of stuff based on the manifest.json that dbt generates for me. But for whatever reason the "data_type" property for each column is always None in the manifest.json, even though I can see it in the catalog.json, I believe the data type is generated from the database.

How do I get the data_type attribute populated in my manifest.json file ?


Solution

  • Some helpful answers from this dbt Slack thread:

    first reply (h/t Daniel Luftspring)

    not sure if this is the only way but i'm running dbt version 0.20.1 you can specify the data_type as a column property in your schema.yml and it will show up in the manifest like so:

    columns:
      - name: city
        data_type: string
    

    If you have a big project and wanted to automate this you could probably pull together a script to edit your schema files in place and sync the data types with your db using the information schema

    second reply (h/t Jonathon Talmi)

    FYI catalog.json has data type becaause it queries the metadata data tables in your dwh (e.g. info schema in snowflake) to contruct the catalog, but your traditional dbt compile/run/etc which. generates a manifest does not have such queries