-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix repo for gatekeeper cert #18
base: main
Are you sure you want to change the base?
Changes from all commits
632d96d
433ec20
b7a5714
77e469a
ac7d67d
07202f6
64d5594
87c3fac
b049dc4
b8ed895
5cb078a
158fcb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: fnl_finance_orders | ||
description: This table has some basic information about the amount and value of orders made per customer split by order status | ||
columns: | ||
- name: customer_id | ||
description: Primary key | ||
tests: | ||
- unique | ||
- not_null | ||
- name: total_orders | ||
description: This is the total number of orders made by a customer | ||
- name: total_amount | ||
description: This is the total amount of money spent by a customer | ||
- name: order_status | ||
description: This is the status of the order | ||
exposures: | ||
- name: fnl_finance_orders | ||
description: Dashboard showing the number and value of orders made per customer split by order status | ||
type: dashboard | ||
url: https://inksacio.eks.octopus.engineering/finance-orders/ | ||
owner: | ||
email: [email protected] | ||
depends_on: | ||
- ref('wh_orders') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
WITH orders AS ( | ||
SELECT | ||
* | ||
FROM {{ ref('wh_orders') }} | ||
) | ||
|
||
SELECT | ||
customer_id | ||
, SUM(amount) AS total_amount | ||
, COUNT(order_id) AS total_orders | ||
, status AS order_status | ||
FROM orders | ||
GROUP BY | ||
customer_id | ||
, order_status |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: fnl_sales_newcustomers | ||
description: This table has some basic information about the number of first time customers per month | ||
columns: | ||
- name: first_order_month | ||
description: Primary key | ||
tests: | ||
- unique | ||
- not_null | ||
- name: new_customer_count | ||
description: New customer count per month | ||
exposures: | ||
- name: fnl_sales_newcustomers | ||
description: Dashboard showing the number and value of new customers per month | ||
type: dashboard | ||
url: https://inksacio.eks.octopus.engineering/sales-newcustomers/ | ||
owner: | ||
email: [email protected] | ||
depends_on: | ||
- ref('wh_customers') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
WITH first_orders AS ( | ||
SELECT | ||
* | ||
FROM {{ ref('wh_customers') }} | ||
) | ||
|
||
SELECT | ||
TRUNC(first_order, "MM") AS first_order_month | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if first_order is a timesamp, it should be localised before truncation :) |
||
, COUNT(DISTINCT customer_id) AS new_customer_count | ||
FROM first_orders | ||
GROUP BY first_order_month |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: stg_customers_pii | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're missing a sensitive config on this _PII table (how do we know to put this model in consumer_sensitive db?) |
||
description: This table has basic information about a customer and contains PII | ||
columns: | ||
- name: customer_id | ||
description: Primary key | ||
tests: | ||
- unique | ||
- not_null | ||
- name: first_name | ||
meta: | ||
sensitive: true | ||
- name: last_name | ||
meta: | ||
sensitive: true | ||
- name: stg_customers | ||
description: This table has basic information about a customer | ||
columns: | ||
- name: customer_id | ||
description: Primary key | ||
tests: | ||
- unique | ||
- not_null | ||
- name: first_name_hash | ||
tests: | ||
- dbt_expectations.expect_column_to_exist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
||
- name: last_name_hash | ||
tests: | ||
- dbt_expectations.expect_column_to_exist | ||
- name: stg_orders | ||
description: This table has basic information about orders | ||
columns: | ||
- name: order_id | ||
description: Primary key | ||
tests: | ||
- unique | ||
- not_null | ||
- name: status | ||
tests: | ||
- accepted_values: | ||
values: ['placed', 'shipped', 'completed', 'return_pending', 'returned'] | ||
- name: stg_payments | ||
description: This table has basic information about payments | ||
columns: | ||
- name: payment_id | ||
description: Primary key | ||
tests: | ||
- unique | ||
- not_null | ||
- name: payment_method | ||
tests: | ||
- accepted_values: | ||
values: ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] |
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') }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
seeds: | ||
- name: raw_customers | ||
description: > | ||
Raw customer data | ||
config: | ||
column_types: | ||
id: int | ||
first_name: string | ||
last_name: string | ||
- name: raw_orders | ||
description: > | ||
Raw orders data | ||
config: | ||
column_types: | ||
id: int | ||
user_id: int | ||
order_date: string | ||
status: string | ||
- name: raw_payments | ||
description: > | ||
Raw payments data | ||
config: | ||
column_types: | ||
id: int | ||
user_id: int | ||
payment_method: string | ||
amount: int |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually encourage only necessary columns to be select as high up in he query as possible (but not a blocker)