dayrize-usecase/dbt/models/sustainability_score.yml

60 lines
1.4 KiB
YAML

version: 2
sources:
- name: products
description: "source table populated and updated by the ETL process"
database: sustainability_score
schema: sustainability_score
tables:
- name: products
models:
- name: material_lookup
description: "lookup table to match materials and their score"
columns:
- name: material
type: string
- name: score
type: float
- name: origin_lookup
description: "lookup table to match product origin and their score"
columns:
- name: origin
type: string
- name: score
type: float
- name: scored_products
description: "table containing the scored products"
columns:
- name: tcin
type: string
description: "product TCIN number"
tests:
- unique
- not_null
- name: material_score
type: float
description: "score calculated from the score"
- name: weight_score
type: float
description: "score calculated from the weight"
- name: packaging_score
type: float
description: "score calculated from the packaging value"
- name: origin_score
type: float
description: "score calculated from the product origin"
- name: score
type: float
description: "sum of material_score, weight_score, packaging_score and origin_score"