meta
- Models
- Sources
- Seeds
- Snapshots
- Tests
- Unit tests
- Analyses
- Macros
- Exposures
- Semantic models
- Metrics
- Saved queries
models:
  <resource-path>:
    +meta: {<dictionary>}
models:
  - name: model_name
    config:
      meta: {<dictionary>}
    columns:
      - name: column_name
        config:
          meta: {<dictionary>} # changed to config in v1.10 and backported to 1.9
The meta config can also be defined:
- under the modelsconfig block indbt_project.yml
- in a config()Jinja macro within a model's SQL file
See configs and properties for details.
sources:
  <resource-path>:
    +meta: {<dictionary>}
sources:
  - name: model_name
    config:
      meta: {<dictionary>}
    tables:
      - name: table_name
        config:
          meta: {<dictionary>}
        columns:
          - name: column_name
            config:
              meta: {<dictionary>} # changed to config in v1.10 and backported to 1.9
seeds:
  <resource-path>:
    +meta: {<dictionary>}
seeds:
  - name: seed_name
    config:
      meta: {<dictionary>}
    columns:
      - name: column_name
        config:
          meta: {<dictionary>} # changed to config in v1.10 and backported to 1.9
The meta config can also be defined under the seeds config block in dbt_project.yml. See configs and properties for details.
snapshots:
  <resource-path>:
    +meta: {<dictionary>}
snapshots:
  - name: snapshot_name
    config:
      meta: {<dictionary>}
    columns:
      - name: column_name
        config:
          meta: {<dictionary>} # changed to config in v1.10 and backported to 1.9
The meta config can also be defined:
- under the snapshotsconfig block indbt_project.yml
- in a config()Jinja macro within a snapshot's SQL block
See configs and properties for details.
You can't add YAML meta configs for generic tests. However, you can add meta properties to singular tests using config() at the top of the test file.
unit_tests:
  <resource-path>:
    +meta: {<dictionary>}
unit_tests:
  - name: <test-name>
    config:
      meta: {<dictionary>}
The meta config is not currently supported for analyses.
macros:
  <resource-path>:
    +meta: {<dictionary>}
macros:
  - name: macro_name
    config:
      meta: {<dictionary>} # changed to config in v1.10
    arguments:
      - name: argument_name
exposures:
  <resource-path>:
    +meta: {<dictionary>}
exposures:
  - name: exposure_name
    config:
      meta: {<dictionary>} # changed to config in v1.10
Configure meta in the your semantic models YAML file or under the semantic-models config block in the dbt_project.yml file.
The meta config can also be defined under the semantic-models config block in dbt_project.yml. See configs and properties for details.
metrics:
  <resource-path>:
    +meta: {<dictionary>}
metrics:
  - name: number_of_people
    label: "Number of people"
    description: Total count of people
    type: simple
    type_params:
      measure: people
    config:
      meta:
        my_meta_config: 'config_value'
saved-queries:
  <resource-path>:
    +meta: {<dictionary>}
saved_queries:
  - name: saved_query_name
    config:
      meta: {<dictionary>}
Definition
The meta field can be used to set metadata for a resource and accepts any key-value pairs. This metadata is compiled into the manifest.json file generated by dbt, and is viewable in the auto-generated documentation.
Depending on the resource you're configuring, meta may be available within the config property, and/or as a top-level key. (For backwards compatibility, meta is often (but not always) supported as a top-level key, though without the capabilities of config inheritance.)
Examples
Designate a model owner
Additionally, indicate the maturity of a model using a model_maturity: key.
models:
  - name: users
    config:
      meta:
        owner: "@alice"
        model_maturity: in dev
Designate a source column as containing PII
sources:
  - name: salesforce
    tables:
      - name: account
        config:
          meta:
            contains_pii: true
        columns:
          - name: email
            config:
              meta: # changed to config in v1.10 and backported to 1.9
                contains_pii: true
Configure one meta attribute for all seeds
seeds:
  +meta:
    favorite_color: red
Override one meta attribute for a single model
{{ config(meta = {
    'single_key': 'override'
}) }}
select 1 as id
Assign owner and favorite_color in the dbt_project.yml as a config property
models:
  jaffle_shop:
    +meta:
      owner: "@alice"
      favorite_color: red
Assign meta to semantic model
The following example shows how to assign a meta value to a semantic model in the semantic_model.yml file and  dbt_project.yml file:
- Semantic model
- dbt_project.yml
semantic_models:
  - name: transaction 
    model: ref('fact_transactions')
    description: "Transaction fact table at the transaction level. This table contains one row per transaction and includes the transaction timestamp."
    defaults:
      agg_time_dimension: transaction_date
    config:
      meta:
        data_owner: "Finance team"
        used_in_reporting: true
semantic-models:
  jaffle_shop:
    +meta:
      used_in_reporting: true
Assign meta to dimensions, measures, entities
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.