← コースに戻る
未ログインのため、この講座の進捗は記録されません。ログインすると記録が残るようになります。
exposures(エクスポージャー)
exposure(エクスポージャー)は、dbtプロジェクトのモデルがダッシュボードやアプリケーションなど「dbtの外側」でどう使われているかを記録する機能。
exposures:
- name: weekly_sales_dashboard
label: 週次売上ダッシュボード
type: dashboard
url: https://bi.example.com/dashboards/1
description: 経営会議で使う週次の売上ダッシュボード
depends_on:
- ref('fct_orders')
- ref('dim_customers')
owner:
name: 山田太郎
email: yamada@example.com
typeには次のような値を指定する。
| type | 対象 |
|---|---|
| dashboard | BIダッシュボード |
| notebook | 分析ノートブック |
| analysis | アドホックな分析 |
| ml | 機械学習モデル |
| application | 業務アプリケーション |
depends_onでそのexposureが依存しているモデルを明示する。exposureを定義しておくと、「このモデルを変更したら、どのダッシュボードに影響するか」をドキュメントサイトから追跡できるほか、dbt run -s +exposure:weekly_sales_dashboardのように、そのexposureに必要なモデルだけを選択して実行することもできる。