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

Joost Boonzajer Flaes via Elementary: Edited dbt tests. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
73 changes: 47 additions & 26 deletions jaffle_shop_online/models/marketing/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ models:

- name: utm_source
data_type: varchar
description: "Source where the ad was displayed. For example, Google, Facebook, Twitter, Newsletter, etc."
description: "Source where the ad was displayed. For example, Google, Facebook,
Twitter, Newsletter, etc."

- name: utm_medium
data_type: varchar
description: "The advertising or marketing medium. The medium can be social media, banners, CPC, third-party blogs, etc."
description: "The advertising or marketing medium. The medium can be social
media, banners, CPC, third-party blogs, etc."

- name: utm_campain
data_type: varchar
Expand All @@ -31,7 +33,8 @@ models:
description: "The USD amount of money spent"

- name: attribution_touches
description: "This is a table that contains all the touch points, by session, with the utm_source, utm_medium and utm_campaign"
description: "This is a table that contains all the touch points, by session,
with the utm_source, utm_medium and utm_campaign"
meta:
owner: "Ella"
config:
Expand All @@ -57,11 +60,13 @@ models:

- name: utm_source
data_type: varchar
description: "Source where the ad was displayed. For example, Google, Facebook, Twitter, Newsletter, etc."
description: "Source where the ad was displayed. For example, Google, Facebook,
Twitter, Newsletter, etc."

- name: utm_medium
data_type: varchar
description: "The advertising or marketing medium. The medium can be social media, banners, CPC, third-party blogs, etc."
description: "The advertising or marketing medium. The medium can be social
media, banners, CPC, third-party blogs, etc."

- name: utm_campain
data_type: varchar
Expand Down Expand Up @@ -116,7 +121,8 @@ models:
description: ""

- name: cpa_and_roas
description: "This table contains the cost per acquisition and return on ad spend, by source, and per month"
description: "This table contains the cost per acquisition and return on ad spend,
by source, and per month"
meta:
owner: "Ella"
config:
Expand All @@ -130,7 +136,8 @@ models:

- name: utm_source
data_type: varchar
description: "Source where the ad was displayed. For example, Google, Facebook, Twitter, Newsletter, etc."
description: "Source where the ad was displayed. For example, Google, Facebook,
Twitter, Newsletter, etc."

- name: attribution_points
data_type: number
Expand All @@ -150,10 +157,12 @@ models:

- name: return_on_advertising_spend
data_type: number
description: "The ROI of the ad spend, calculated as attribution_revenue / total_spend"
description: "The ROI of the ad spend, calculated as attribution_revenue /
total_spend"

- name: marketing_ads
description: "This table contains information on the ad spend, by source, medium and campaign"
description: "This table contains information on the ad spend, by source, medium
and campaign"
meta:
owner: "Ella"
config:
Expand All @@ -171,7 +180,8 @@ models:

- name: utm_medium
data_type: varchar
description: "The advertising or marketing medium. The medium can be social media, banners, CPC, third-party blogs, etc."
description: "The advertising or marketing medium. The medium can be social
media, banners, CPC, third-party blogs, etc."

- name: utm_campain
data_type: varchar
Expand All @@ -183,16 +193,17 @@ models:

- name: utm_source
data_type: varchar
description: "Source where the ad was displayed. For example, Google, Facebook, Twitter, Newsletter, etc."
description: "Source where the ad was displayed. For example, Google, Facebook,
Twitter, Newsletter, etc."

- name: agg_sessions
description: "This table contains aggregated information on the sessions"
meta:
owner: "Ella"
config:
tags: ["marketing"]
elementary:
timestamp_column: "started_at"
tags: ["marketing"]
elementary:
timestamp_column: "started_at"
columns:
- name: session_id
data_type: varchar
Expand All @@ -212,24 +223,26 @@ models:

- name: utm_source
data_type: varchar
description: "Source where the ad was displayed. For example, Google, Facebook, Twitter, Newsletter, etc."
description: "Source where the ad was displayed. For example, Google, Facebook,
Twitter, Newsletter, etc."

- name: ad_id
data_type: varchar
description: "Unique identifier for an ad"

- name: platform
data_type: varchar
description: "Platform where the session was made. For example, website, iOS app, Android app, etc."
description: "Platform where the session was made. For example, website, iOS
app, Android app, etc."

- name: customer_conversions
description: "This table contains information on the conversions of all the customers"
meta:
owner: "Ella"
config:
tags: ["marketing", "finance", "pii"]
elementary:
timestamp_column: "converted_at"
tags: ["marketing", "finance", "pii"]
elementary:
timestamp_column: "converted_at"
columns:
- name: customer_id
data_type: number
Expand All @@ -244,13 +257,14 @@ models:
description: "Total revenue amount (USD) of the conversion"

- name: sessions
description: "This table contains information on the sessions of all the customers and the utm_source, utm_medium and utm_campaign of the session"
description: "This table contains information on the sessions of all the customers
and the utm_source, utm_medium and utm_campaign of the session"
meta:
owner: "Ella"
config:
tags: ["marketing", "pii"]
elementary:
timestamp_column: "started_at"
tags: ["marketing", "pii"]
elementary:
timestamp_column: "started_at"
columns:
- name: session_id
data_type: varchar
Expand All @@ -260,6 +274,11 @@ models:
data_type: number
description: "Unique identifier for a customer"

data_tests:
- unique:
meta:
description: The customer_id column in the sessions table should contain
only unique values
- name: started_at
data_type: timestamp_ntz
description: "Time (UTC) when the session started"
Expand All @@ -270,12 +289,14 @@ models:

- name: utm_source
data_type: varchar
description: "Source where the ad was displayed. For example, Google, Facebook, Twitter, Newsletter, etc."
description: "Source where the ad was displayed. For example, Google, Facebook,
Twitter, Newsletter, etc."

- name: utm_medium
data_type: varchar
description: "The advertising or marketing medium. The medium can be social media, banners, CPC, third-party blogs, etc."
description: "The advertising or marketing medium. The medium can be social
media, banners, CPC, third-party blogs, etc."

- name: utm_campain
data_type: varchar
description: "The name of the advertising campaign"
description: "The name of the advertising campaign"