groups Flashcards
(12 cards)
What is a dbt group?
A dbt group is a named collection of nodes in the dbt DAG that share an owner and can be used to manage access and collaboration within or across teams.
Which dbt nodes can be included in a group?
Groups can include models, tests, seeds, snapshots, analyses, and metrics. Sources and exposures cannot be included in a group.
How many groups can a dbt node belong to?
Each node can belong to only one group.
How is a dbt group declared in a project?
A group is declared in a YAML file under the groups:
key, with required name
and owner
fields, and optional description
and config.meta
fields.
What is required when declaring the owner
of a group?
The owner
must include a name
or email
. Additional properties are currently allowed but will be disallowed in future releases.
How do you add a model to a dbt group?
You can add a model to a group using the +group
configuration either at the project level in dbt_project.yml
, at the model-level config, or inline within the YAML model definitions.
What is the default access level for models in a group?
By default, grouped models have the protected
access level, meaning they can be referenced by other resources in the same project.
What happens when a grouped model’s access is set to private
?
When a model’s access is set to private
, only other resources within the same group can reference it using ref()
.
What error occurs if a model in another group tries to reference a private model?
A DbtReferenceError
will occur, indicating that the model being referenced is private and cannot be accessed by a model in a different group.
Where is the group assigned in dbt_project.yml
?
In dbt_project.yml
, the group is assigned under the models:
section using the +group:
key at the appropriate namespace level.
Can you use ref()
to access models across groups?
Yes, but only if the model being referenced has the protected
access level. private
models cannot be referenced across groups.
How do groups help with team collaboration in dbt?
Groups support intentional collaboration by organizing related resources, enforcing access boundaries, and assigning clear ownership, enhancing governance and modularity.