-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Look for workflow_save and workflow_enable workflow IDs in other places
- Loading branch information
1 parent
f908ba2
commit 43e8d24
Showing
10 changed files
with
132 additions
and
5 deletions.
There are no files selected for viewing
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
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,47 @@ | ||
-- tests/workflow_enables_count_proportion.sql | ||
{% set lookback_window_days = 30 %} | ||
{% set min_enable_percent = 0.05 %} | ||
|
||
WITH filtered_data AS ( | ||
SELECT | ||
* | ||
FROM | ||
{{ ref('workflows') }} | ||
WHERE | ||
created_at_pt >= CURRENT_DATE - INTERVAL '30 days' | ||
AND enable_count >= 1 | ||
), | ||
|
||
total_count AS ( | ||
SELECT | ||
COUNT(*) AS total | ||
FROM | ||
{{ ref('workflows') }} | ||
), | ||
|
||
filtered_count AS ( | ||
SELECT | ||
COUNT(*) AS filtered | ||
FROM | ||
filtered_data | ||
), | ||
|
||
proportion_data AS ( | ||
SELECT | ||
filtered::FLOAT / total AS proportion | ||
FROM | ||
(SELECT filtered FROM filtered_count) AS fc, | ||
(SELECT total FROM total_count) AS tc | ||
) | ||
|
||
SELECT | ||
'The proportion of workflows enabled in the last ' | ||
|| {{ lookback_window_days }} | ||
|| ' days is below ' | ||
|| {{ min_enable_percent * 100 }} | ||
|| '%' AS error_message, | ||
proportion | ||
FROM | ||
proportion_data | ||
WHERE | ||
proportion < {{ min_enable_percent }} |
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,43 @@ | ||
-- tests/workflow_saves_count_proportion.sql | ||
{% set lookback_window_days = 30 %} | ||
{% set min_save_percent = 0.05 %} | ||
|
||
WITH filtered_data AS ( | ||
SELECT | ||
* | ||
FROM | ||
{{ ref('workflows') }} | ||
WHERE | ||
created_at_pt >= CURRENT_DATE - INTERVAL '{{ lookback_window_days }} days' | ||
AND save_count >= 1 | ||
), | ||
|
||
total_count AS ( | ||
SELECT | ||
COUNT(*) AS total | ||
FROM | ||
{{ ref('workflows') }} | ||
), | ||
|
||
filtered_count AS ( | ||
SELECT | ||
COUNT(*) AS filtered | ||
FROM | ||
filtered_data | ||
), | ||
|
||
proportion_data AS ( | ||
SELECT | ||
filtered::FLOAT / total AS proportion | ||
FROM | ||
(SELECT filtered FROM filtered_count) AS fc, | ||
(SELECT total FROM total_count) AS tc | ||
) | ||
|
||
SELECT | ||
'The proportion of workflows saved in the last {{ lookback_window_days }} days is below {{ min_save_percent * 100 }}%' AS error_message, | ||
proportion | ||
FROM | ||
proportion_data | ||
WHERE | ||
proportion < {{ min_save_percent }} |
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,8 @@ | ||
version: 2 | ||
models: | ||
- name: int_shop_weeks | ||
columns: | ||
- name: week | ||
- name: shop_subdomain | ||
- name: inc_amount | ||
- name: first_week |
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
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,24 @@ | ||
version: 2 | ||
models: | ||
- name: stg_ga_session_starts | ||
columns: | ||
- name: user_pseudo_id | ||
- name: page_location | ||
- name: event_timestamp_pt | ||
- name: page_url | ||
- name: page_host | ||
- name: page_path | ||
- name: page_query | ||
- name: utm_campaign | ||
- name: utm_medium | ||
- name: utm_source | ||
- name: device_category | ||
- name: utm_content | ||
- name: utm_term | ||
- name: app_store_surface_detail | ||
- name: app_store_surface_type | ||
- name: app_store_surface_intra_position | ||
- name: app_store_surface_inter_position | ||
- name: app_store_locale | ||
- name: shopify_id | ||
- name: shop_subdomain |
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 |
---|---|---|
|
@@ -63,4 +63,4 @@ ahn-devstore | |
shoppad321 | ||
kalen-jordan-dev | ||
anh-devstore | ||
shoppad-jen | ||
shoppad-jen |