Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
add segment recency tests (singer-io#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdimercurio authored Nov 29, 2018
1 parent 8552d7e commit 60a462e
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/careplatform/base/careplatform_tracks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ config(materialized='view') }}

select * from careplatform.tracks
11 changes: 11 additions & 0 deletions models/careplatform/base/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@ models:
- name: timestamp
tests:
- not_null

- name: careplatform_tracks
columns:
- name: timestamp
tests:
- not_null
tests:
- dbt_utils.recency:
field: timestamp
datepart: hour
interval: 15
3 changes: 3 additions & 0 deletions models/countdown/base/countdown_tracks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ config(materialized='view') }}

select * from countdown.tracks
14 changes: 14 additions & 0 deletions models/countdown/base/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

version: 2

models:
- name: countdown_tracks
columns:
- name: timestamp
tests:
- not_null
tests:
- dbt_utils.recency:
field: timestamp
datepart: hour
interval: 15
6 changes: 6 additions & 0 deletions models/delighted/base/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ models:
tests:
- not_null

tests:
- dbt_utils.recency:
field: timestamp
datepart: hour
interval: 24

- name: delighted_nps_dm_survey
columns:
- name: email
Expand Down
15 changes: 15 additions & 0 deletions models/messaging/base/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

version: 2

models:
- name: messaging_posts
columns:
- name: created_at
tests:
- not_null

tests:
- dbt_utils.recency:
field: created_at
datepart: hour
interval: 15
6 changes: 6 additions & 0 deletions models/patientapp/base/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ models:
- not_null
- accepted_values:
values: ['iOS', 'Android', 'Desktop']

tests:
- dbt_utils.recency:
field: timestamp
datepart: hour
interval: 15
12 changes: 12 additions & 0 deletions models/scribe/base/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,15 @@ models:
- name: timestamp
tests:
- not_null

- name: scribe_tracks
columns:
- name: timestamp
tests:
- not_null

tests:
- dbt_utils.recency:
field: timestamp
datepart: hour
interval: 15
3 changes: 3 additions & 0 deletions models/scribe/base/scribe_tracks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ config(materialized='view') }}

select * from scribe.tracks
16 changes: 16 additions & 0 deletions models/usher/base/schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

version: 2

models:

- name: usher_tracks
columns:
- name: timestamp
tests:
- not_null

tests:
- dbt_utils.recency:
field: timestamp
datepart: hour
interval: 15
3 changes: 3 additions & 0 deletions models/usher/base/usher_tracks.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ config(materialized='view') }}

select * from usher.tracks
1 change: 1 addition & 0 deletions style_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ having count(*) > 1
* Every model should be tested in a schema.yml file
* At minimum, unique and foreign key constraints should be tested (if applicable)
* Any failing tests should be fixed or explained prior to requesting a review
* Every Segment schema should be tested for recency. The prefered way of testing is to check that the last timestamp was received less than 15 hours ago in the tracks table.

0 comments on commit 60a462e

Please sign in to comment.