Model properties
Models properties can be declared in .yml files in your models/ directory (as defined by the model-paths config).
You can name these files whatever_you_want.yml, and nest them arbitrarily deeply in subfolders within the models/ directory.
Availability
The latest YAML spec is supported in the following environments:
- dbt platform (Latest release track)
- dbt Fusion engine
- dbt Core v1.12
For more information, refer to Migrate to the latest YAML spec.
Available top-level model properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | The model name (must match the model filename). |
| description | string | No | Documentation for the model. |
| columns | array | No | List of column definitions. |
| config | object | No | Model configuration (materialization, tags, etc.). |
| constraints | array | No | Model-level constraints (primary key, foreign key, etc.). |
| data_tests | array | No | Model-level data tests. |
| tests | array | No | Legacy alias for data_tests. |
| versions | array | No | Model version definitions. |
| latest_version | string/float | No | The latest version of the model. |
| deprecation_date | string | No | Date when the model is deprecated. |
| access | string | No | Access level: private, protected, or public. Supported at the top-level for backwards compatibility only. |
| time_spine | object | No | Time spine configuration for the Semantic Layer. |
| semantic_model | object | No | Latest YAML spec only. Enable semantic model configuration for the Semantic Layer with enabled: true. For other properties, refer to Semantic model properties. |
| metrics | array | No | Latest YAML spec only. Metrics derived from this semantic model; list is alongside (not under) semantic_model and columns. For other properties, refer to Metric properties. |
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
0