Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions models/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ models:
- name: total_order_amount
description: Total value (AUD) of a customer's orders

tests:
- no_warn_tests:
severity: error
where: "{{ 'warn' in config.get('severity') }}"
- has_primary_key:
severity: error
where: "{{ adapter.get_columns_in_relation(ref('customers')).primary_key }}"

- name: orders
description: This table has basic information about orders, as well as some derived facts based on payments

Expand Down Expand Up @@ -80,3 +88,11 @@ models:
description: Amount of the order (AUD) paid for by gift card
tests:
- not_null

tests:
- no_warn_tests:
severity: error
where: "{{ 'warn' in config.get('severity') }}"
- has_primary_key:
severity: error
where: "{{ adapter.get_columns_in_relation(ref('orders')).primary_key }}"
10 changes: 10 additions & 0 deletions seeds/load_raw_customers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ config(
materialized='view',
seeds__quote_columns=False
) }}

select
id,
first_name,
last_name
from {{ source('jaffle_shop_duckdb', 'raw_customers.csv') }}
11 changes: 11 additions & 0 deletions seeds/load_raw_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ config(
materialized='view',
seeds__quote_columns=False
) }}

select
id,
user_id,
order_date,
status
from {{ source('jaffle_shop_duckdb', 'raw_orders.csv') }}
11 changes: 11 additions & 0 deletions seeds/load_raw_payments.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ config(
materialized='view',
seeds__quote_columns=False
) }}

select
id,
order_id,
payment_method,
amount
from {{ source('jaffle_shop_duckdb', 'raw_payments.csv') }}