Skip to content

Commit 2996ffe

Browse files
authored
Merge pull request #9 from DataCody/dev
Updated test file.
2 parents 7e5dcb4 + 6a5355c commit 2996ffe

2 files changed

Lines changed: 60 additions & 3 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
version: 2
22

33
models:
4-
- name: int_orders_enriched
4+
- name: inter_order_items_enriched
55
description: "Intermediate model that enriches order data by combining order and order_items. Includes derived metrics like total order amount."
66
columns:
77
- name: total_amount
88
description: "Total monetary value of the order, usually calculated as the sum of product_price for all items in the order."
99
tests:
1010
- not_null
1111
- accepted_range:
12-
min_value: 0
12+
arguments:
13+
min_value: 0

dbt/models/staging/stg_big_star_db.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,60 @@ models:
4141
tests:
4242
- relationships:
4343
field: customer_id
44-
to: ref('stg_customers')
44+
to: ref('stg_customers')
45+
46+
- name: stg_order_items
47+
description: "Staging table for order item data, representing the products included in each order."
48+
columns:
49+
- name: order_item_id
50+
description: "Unique identifier for each item in an order."
51+
tests:
52+
- unique
53+
- not_null
54+
- name: order_id
55+
description: "Reference to the related order."
56+
tests:
57+
- not_null
58+
- relationships:
59+
to: ref('stg_orders')
60+
field: order_id
61+
- name: product_id
62+
description: "Reference to the purchased product."
63+
tests:
64+
- not_null
65+
- relationships:
66+
to: ref('stg_products')
67+
field: product_id
68+
- name: product_price
69+
description: "Price of the product at the time of purchase."
70+
tests:
71+
- not_null
72+
73+
- name: stg_products
74+
description: "Staging table for product data, containing product details and attributes."
75+
columns:
76+
- name: product_id
77+
description: "Unique identifier for each product."
78+
tests:
79+
- unique
80+
- not_null
81+
- name: product_name
82+
description: "The name of the product."
83+
tests:
84+
- not_null
85+
- name: category
86+
description: "Product category (e.g., electronics, apparel)."
87+
- name: collection
88+
description: "Grouping or collection that the product belongs to."
89+
- name: price
90+
description: "Standard retail price of the product."
91+
tests:
92+
- not_null
93+
- name: rating
94+
description: "Average customer rating of the product."
95+
tests:
96+
- not_null
97+
- name: availability
98+
description: "Availability status of the product (e.g., in stock, out of stock)."
99+
tests:
100+
- not_null

0 commit comments

Comments
 (0)