dayrize-usecase/dbt/models/sustainability_score.yml

69 lines
1.7 KiB
YAML
Raw Normal View History

2023-06-25 20:53:51 +02:00
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: category_material_scores
description: "view holding the material score of each primary_category"
2023-06-25 20:53:51 +02:00
- 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: ingestion_time
type: timestamp
description: "timestamp of when the row was inserted or updated by the ETL process"
tests:
- not_null
2023-06-25 20:53:51 +02:00
- 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"