Skip to main content

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 available in the dbt platform Latest release track and the dbt Fusion engine.

Support in dbt Core is planned for v1.12.

For more information, refer to Migrate to the latest YAML spec.

Available top-level model properties

PropertyTypeRequiredDescription
namestringYesThe model name (must match the model filename).
descriptionstringNoDocumentation for the model.
columnsarrayNoList of column definitions.
configobjectNoModel configuration (materialization, tags, etc.).
constraintsarrayNoModel-level constraints (primary key, foreign key, etc.).
data_testsarrayNoModel-level data tests.
testsarrayNoLegacy alias for data_tests.
versionsarrayNoModel version definitions.
latest_versionstring/floatNoThe latest version of the model.
deprecation_datestringNoDate when the model is deprecated.
accessstringNoAccess level: private, protected, or public. Supported at the top-level for backwards compatibility only.
time_spineobjectNoTime spine configuration for the Semantic Layer.
semantic_modelobjectNoLatest YAML spec only. Enable semantic model configuration for the Semantic Layer with enabled: true. For other properties, refer to Semantic model properties.
metricsarrayNoLatest 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.
Loading table...

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading