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
|
|
|
|
|
2023-06-25 22:41:58 +02:00
|
|
|
- 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
|
|
|
|
|
2023-06-25 22:41:58 +02:00
|
|
|
- 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"
|