Model Access, Versions, and Deprecation
dbt Analytics Engineering · Lesson 10 of 17 · 1:14:54
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the dbt Analytics Engineering Certification exam. In this lesson: groups and access (private, protected, public), model versions and latest_version, pinned and unpinned references to versions, and deprecation dates. Includes three original practice questions, with Orchardline Meal Kits, a fictional meal-kit company, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
One mart, many consumers
Orchardline's customers mart is read by finance dashboards, a partner export, and two other dbt projects. The team must remove an unreliable column, but cannot migrate every consumer on the same day, and a marketing model already refs a half finished finance helper. This lesson covers groups and model access, model versions, and deprecation dates.
Groups and access
A group gathers models under a shared owner, like the finance team, and each model belongs to one group at most. The access modifier then decides which models may ref a model. Private means only models in the same group, protected means the same project, or a project that installs it as a package, and public means any group, package, or project. By default, every model is protected. If a model refs another one outside its allowed access, dbt raises a reference error while parsing the project.
Model versions
When a public model that consumers outside your team depend on needs a breaking change, create a new model version, instead of breaking them all at once. In YAML, the model lists its versions, each with a v number, and names a latest version, while each version can include or exclude columns from a shared definition. Each version is stored in its own file, named after the model with an underscore, a v, and the number, and builds its own relation in the warehouse. A version above the latest one is a prerelease, which consumers can try before it becomes the default. Versions have a cost, since each one is built and maintained, so prefer non breaking changes, and move the latest version on a predictable cadence.
Referencing versions
A ref with a version argument, like v equals one, always points to that version. A ref without a version argument, called an unpinned ref, resolves to the latest version, and dbt warns when a newer prerelease exists. So consumers who pin a version are protected from breaking changes, while unpinned refs follow the latest version automatically. In node selection, the version method picks versions, like the latest or the old ones, for example to skip old versions in development.
Deprecation
A deprecation date, set on a model or on a version, announces when it will be removed, as a date with an optional time zone offset. Referencing a model whose deprecation date is near, or has passed, produces a warning, and the warning names the newer version when one exists. You can promote these warnings to errors with the warn error options flag. And if the model has an enforced contract, dbt does not let you delete it before its deprecation date has passed. Together, versions and deprecation dates give consumers a clear migration window.
Recap
Let's recap. Groups give models an owner, and access decides who may ref them: private, protected by default, or public. Versions let a public model change shape, while consumers migrate at their own pace. A pinned ref keeps its version, and an unpinned ref follows the latest one. A deprecation date warns consumers, and can become an error with warn error options. And a contracted model cannot be deleted before its deprecation date.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
The finance group’s tax rates helper is private, and a model in the marketing group refs it. What happens?
- It works, since both models are in the same project
- dbt raises a reference error while parsing
- dbt copies the helper into the marketing group
- It works, but dbt shows a warning
Show the answer
dbt raises a reference error while parsing
A private model can only be referenced from its own group, so dbt stops with a reference error. “It works, since both models are in the same project” would hold for a protected model, not for a private one. “dbt copies the helper into the marketing group” is wrong, since dbt never moves models between groups. And “It works, but dbt shows a warning” is wrong, since access violations are errors, not warnings.
The customers mart has versions 1 and 2, and 2 is the latest. Version 3 is added as a prerelease. Which version does ref('customers') return?
- Version 3, since it has the highest number
- Version 1, since it is the oldest one
- None: dbt raises an error, as the ref must be pinned
- Version 2, the latest version
Show the answer
Version 2, the latest version
An unpinned ref resolves to the latest version, and a prerelease is not the latest until its maintainer says so. “Version 3, since it has the highest number” is wrong, since a higher number alone does not make a version the latest. “Version 1, since it is the oldest one” is wrong, since unpinned refs never fall back to the oldest version. And “None: dbt raises an error, as the ref must be pinned” is wrong, since unpinned refs are allowed, and dbt only warns that a prerelease exists.
Consumers of version 1 of the customers mart should get warnings from next month, and the team wants to delete that version later. What should the team set?
- A deprecation_date on version 1
- access: private on version 1
- latest_version: 1 on the model
- A post-hook that drops version 1
Show the answer
A deprecation_date on version 1
A deprecation date makes every reference to version one raise a warning, and allows the contracted version to be deleted once the date has passed. “access: private on version 1” is wrong, since private access would break the consumers immediately. “latest_version: 1 on the model” is wrong, since it would make version one the default again. And “A post-hook that drops version 1” is wrong, since dropping the table breaks consumers without any warning.