Exposures make it possible to define and describe a downstream use of your dbt project, such as in a dashboard, application, or data science pipeline. By defining exposures, you can then:
- run, test, and list resources that feed into your exposure
- populate a dedicated page in the auto-generated documentation site with context relevant to data consumers
Declaring an exposure
Exposures are defined in
.yml files in your
models directory (as defined by the
source-paths config), nested under an
exposures:- name: weekly_jaffle_metricstype: dashboardmaturity: highurl: https://bi.tool/dashboards/1description: >Did someone say "exponential growth"?depends_on:- ref('fct_orders')- ref('dim_customers')- source('gsheets', 'goals')owner:name: Claire from Dataemail: firstname.lastname@example.org
- name (must be unique among exposures)
- type: one of
application(used to organize in docs site)
- owner: email
- depends_on: list of refable nodes (
- maturity: one of
- owner: name
General properties (optional)
We plan to add more subtypes and optional properties in future releases.
Once an exposure is defined, you can run commands that reference it:
dbt run -s +exposure:weekly_jaffle_metricsdbt test -s +exposure:weekly_jaffle_metrics
When we generate our documentation site, you'll see the exposure appear:
Exposures are new!
Exposures were introduced in dbt v0.18.1, with a limited set of supported types and properties. If you're interested in requesting or contributing additional properties, check out issue dbt#2835.