forked from dbt-labs/jaffle-shop-classic
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
716 additions
and
453 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: 2 | ||
|
||
exposures: | ||
- name: fnl_finance_orders_per_customer | ||
description: Used in Inksacio app | ||
type: application | ||
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/ | ||
owner: | ||
email: [email protected] | ||
depends_on: | ||
- ref('wh_customers') | ||
|
||
models: | ||
- name: fnl_finance_orders_per_customer | ||
description: This table contains the total value of orders per customer | ||
columns: | ||
- name: customer_id | ||
description: This is a unique identifier for a customer | ||
tests: | ||
- unique | ||
- not_null | ||
- name: customer_lifetime_value | ||
description: This is the total value of orders for a customer |
4 changes: 4 additions & 0 deletions
4
jaffle_shop/models/final/finance/fnl_finance_orders_per_customer.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT | ||
customers.customer_id | ||
, customers.customer_lifetime_value | ||
FROM {{ ref('wh_customers') }} AS customers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: 2 | ||
|
||
exposures: | ||
- name: fnl_sales_newcustomers | ||
description: Used in Inksacio app | ||
type: application | ||
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/ | ||
owner: | ||
email: [email protected] | ||
depends_on: | ||
- ref('wh_customers') | ||
|
||
models: | ||
- name: fnl_sales_newcustomers | ||
description: This table contains the number of new customers per month | ||
columns: | ||
- name: month_start_date | ||
description: This is a date representing the start of a month | ||
tests: | ||
- unique | ||
- not_null | ||
- name: new_customer_count | ||
description: This is the number of new customers in a given month |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SELECT | ||
DATE_TRUNC('MONTH', customers.first_order) AS month_start_date | ||
, COUNT(customers.customer_id) AS new_customer_count | ||
FROM {{ ref('wh_customers') }} AS customers | ||
GROUP BY DATE_TRUNC('MONTH', customers.first_order) | ||
ORDER BY DATE_TRUNC('MONTH', customers.first_order) DESC |
18 changes: 18 additions & 0 deletions
18
jaffle_shop/models/staging/schema.yml → ..._shop/models/staging/src_seed/_models.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT | ||
{{ hash_sensitive_columns('stg_customers_pii') }} | ||
FROM {{ ref('stg_customers_pii') }} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |