Exposures Flashcards
(15 cards)
What is a dbt exposure?
A dbt exposure is a documentation artifact that describes how data is used outside of dbt, such as in dashboards, notebooks, or applications. It helps track data lineage to end use cases.
Where should an exposure be defined in a dbt project?
An exposure should be defined in a YAML file within the models/
directory, typically named models/<filename>.yml
.
What are the required properties for defining a dbt exposure?
The required properties are: name
(unique and in snake_case), type
(e.g., dashboard, notebook), and owner
(with a required name
or email
).
What values are allowed for the type
property in a dbt exposure?
Valid values for type
include: dashboard
, notebook
, analysis
, ml
, and application
. These categorize how the exposure is used.
What is the purpose of the owner
field in an exposure definition?
The owner
field documents the responsible party for the exposure, requiring at least a name
or email
, and can include additional metadata.
What does the depends_on
property specify in an exposure?
depends_on
lists the dbt objects that the exposure relies on, such as models (ref()
), sources (source()
), and metrics (metric()
).
Why is it unusual for an exposure to directly depend on a source?
While technically possible, it’s uncommon because exposures typically depend on transformed models rather than raw source data.
What does the label
field do in a dbt exposure?
The label
provides a human-readable name for the exposure that may contain spaces and special characters, improving documentation clarity.
What is the role of the url
property in a dbt exposure?
The url
links the exposure to its external resource (e.g., a dashboard), enabling a ‘View this exposure’ link in dbt Docs.
What does the maturity
property represent in a dbt exposure?
The maturity
level indicates confidence or stability, with values such as high
, medium
, or low
, guiding stakeholders on trust levels.
What are some optional general properties for exposures?
Optional properties include description
, tags
, meta
, and enabled
. These enhance documentation and control exposure visibility.
How do you reference an exposure in dbt CLI commands?
You can reference an exposure using the +exposure:<exposure_name>
syntax, for example: dbt run -s +exposure:weekly_jaffle_report
.
Where do exposures appear in dbt Explorer?
Exposures are listed under the ‘Resources’ tab and shown as nodes in the DAG with an orange ‘EXP’ indicator.
What visual cue identifies exposures in the dbt DAG?
In the dbt DAG, exposures are marked with an orange ‘EXP’ icon, distinguishing them from other node types.
How does defining exposures improve a dbt project?
Exposures help map the downstream usage of data models, increasing transparency, traceability, and accountability across the data stack.