Skip to content

adding sql files and yml file config #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: duckdb
Choose a base branch
from
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') }}