Skip to content
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

Joanna gatekeeper cert v2 #15

Open
wants to merge 5 commits into
base: main
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
1,014 changes: 656 additions & 358 deletions Pipfile.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions jaffle_shop/models/final/finance/_models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2

exposures:
- name: fnl_finance_customerreturns
description: Data source for dashboard tool
type: dashboard
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/
owner:
email: [email protected]
depends_on:
- ref('fnl_finance_customerreturns')
models:
- name: fnl_finance_customerreturns
description: One row per customer. Gives the total value of returns made by that customer
columns:
- name: customer_id
description: This is a unique identifier for a customer
tests:
- unique
- not_null
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
customer_id
, SUM(amount) AS total_returned_amount
FROM {{ ref('wh_orders') }}
WHERE status IN ('return_pending', 'returned')
GROUP BY customer_id
20 changes: 20 additions & 0 deletions jaffle_shop/models/final/sales/_models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2

exposures:
- name: fnl_sales_newcustomermonth
description: Data source for dashboard tool
type: dashboard
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/
owner:
email: [email protected]
depends_on:
- ref('fnl_sales_newcustomermonth')
models:
- name: fnl_sales_newcustomermonth
description: One row per month. Gives the number of customers to make their first order for that month
columns:
- name: first_order_month
description: The month that the first order was made
tests:
- unique
- not_null
4 changes: 4 additions & 0 deletions jaffle_shop/models/final/sales/fnl_sales_newcustomermonth.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT
DATE_TRUNC('month', first_order) AS first_order_month
, COUNT(DISTINCT customer_id) AS num_customers
FROM {{ ref('wh_customers') }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
version: 2

models:
- name: stg_customers
- name: stg_customers_pii
meta:
sensitive: true
columns:
- name: customer_id
tests:
- unique
- not_null
- name: first_name
meta:
sensitive: true
- name: last_name
meta:
sensitive: true

- name: stg_customers
columns:
- name: customer_id
tests:
- unique
- not_null
- name: stg_orders
columns:
- name: order_id
Expand Down
3 changes: 3 additions & 0 deletions jaffle_shop/models/staging/src_seed/stg_customers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT
{{ hash_sensitive_columns('stg_customers_pii') }}
FROM {{ ref('stg_customers_pii') }}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

models:
- name: customers
- name: wh_customers
description: This table has basic information about a customer, as well as some derived facts based on a customer's orders

columns:
Expand Down Expand Up @@ -29,7 +29,7 @@ models:
- name: total_order_amount
description: Total value (AUD) of a customer's orders

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

columns:
Expand All @@ -44,7 +44,7 @@ models:
tests:
- not_null
- relationships:
to: ref('customers')
to: ref('wh_customers')
field: customer_id

- name: order_date
Expand Down
2 changes: 2 additions & 0 deletions jaffle_shop/seeds/dbt_project_evaluator_exceptions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fct_name,column_name,id_to_exclude,comment
fct_staging_dependent_on_staging,parent,stg_customers_pii,Scrubbing pii permitted in staging layer.