Skip to content

Commit

Permalink
Add base macros
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewoodhead committed Nov 21, 2023
1 parent ce73700 commit 1ca6e6f
Show file tree
Hide file tree
Showing 27 changed files with 2,993 additions and 3,664 deletions.
22 changes: 10 additions & 12 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ vars:
snowplow__dev_target_name: 'dev'
# snowplow__atomic_schema: 'atomic' # Only set if not using 'atomic' schema for Snowplow events data
# snowplow__database: # Only set if not using target.database for Snowplow events data -- WILL BE IGNORED FOR DATABRICKS
# snowplow__events_table: 'events' # Only set if not using 'events' table for Snowplow events data

# Variables - Operation and logic
snowplow__complete_play_rate: 0.99
Expand All @@ -48,8 +49,12 @@ vars:
snowplow__upsert_lookback_days: 30
snowplow__allow_refresh: false
snowplow__app_id: []

snowplow__session_timestamp: collector_tstamp # Used to manage utils version higher than 0.15.1, do not change until new base macro is used
snowplow__session_timestamp: collector_tstamp
# please refer to the macros within identifiers.sql for default session and user values
snowplow__session_identifiers: []
# snowplow__session_sql: 'sc.session_id' # takes priority over session_identifiers
snowplow__user_identifiers: []
# snowplow__user_sql: 'sc.user_id' # takes priority over user identifiers

# Variables - Contexts, filters, and logs
# please set any of the below three variables to true if the related context schemas are enabled for your warehouse, please note it cannot be used to filter the data:
Expand Down Expand Up @@ -85,6 +90,7 @@ vars:
snowplow__derived_tstamp_partitioned: true
snowplow__query_tag: 'snowplow_dbt'
snowplow__enable_load_tstamp: true
snowplow__entities_or_sdes: []
# Databricks Only
# Depending on the use case it should either be the catalog (for Unity Catalog users from databricks connector 1.1.1 onwards) or the same value as your snowplow__atomic_schema (unless changed it should be 'atomic')
# snowplow__databricks_catalog: 'hive_metastore'
Expand All @@ -93,9 +99,9 @@ vars:
on-run-start:
- '{{ snowplow_media_player_delete_from_manifest(var("models_to_remove",[])) }}'

# Update manifest table with last event consumed per sucessfully executed node/model
# Update manifest table with last event consumed per successfully executed node/model
on-run-end:
- '{{ snowplow_utils.snowplow_incremental_post_hook("snowplow_media_player") }}'
- '{{ snowplow_utils.snowplow_incremental_post_hook("snowplow_media_player", "snowplow_media_player_incremental_manifest", "snowplow_media_player_base_events_this_run", var("snowplow__session_tstamp", "collector_tstamp")) }}'

models:
snowplow_media_player:
Expand All @@ -104,14 +110,6 @@ models:
base:
manifest:
+schema: "snowplow_manifest"
bigquery:
+enabled: "{{ target.type == 'bigquery' | as_bool() }}"
databricks:
+enabled: "{{ target.type in ['databricks', 'spark'] | as_bool() }}"
default:
+enabled: "{{ target.type in ['redshift', 'postgres'] | as_bool() }}"
snowflake:
+enabled: "{{ target.type == 'snowflake' | as_bool() }}"
scratch:
+schema: 'scratch'
+tags: 'scratch'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
play_id,page_view_id,media_identifier,player_id,media_label,session_identifier,domain_userid,user_id,page_referrer,page_url,source_url,geo_region_name,br_name,dvce_type,os_name,os_timezone,platform,duration_secs,media_type,media_player_type,start_tstamp,end_tstamp,paused_time_secs,buffering_time_secs,ads_time_secs,seeks,ads,ads_clicked,ads_skipped,ad_breaks,is_played,is_valid_play,is_complete_play,percent_progress_reached,play_time_secs,play_time_muted_secs,avg_playback_rate,retention_rate,content_watched_secs,content_watched_percent
play_id,page_view_id,media_identifier,player_id,media_label,session_identifier,user_identifier,user_id,page_referrer,page_url,source_url,geo_region_name,br_name,dvce_type,os_name,os_timezone,platform,duration_secs,media_type,media_player_type,start_tstamp,end_tstamp,paused_time_secs,buffering_time_secs,ads_time_secs,seeks,ads,ads_clicked,ads_skipped,ad_breaks,is_played,is_valid_play,is_complete_play,percent_progress_reached,play_time_secs,play_time_muted_secs,avg_playback_rate,retention_rate,content_watched_secs,content_watched_percent
d37760b0061292a5ac168324c5a4befe,70d2839e-c8a6-4cbc-abc5-e1ff763a82b3,ae9ad2ba4e69068fa1807c9f41d9235a,html-dbt,dbt Coalesce 2021 - Data modeling at Scale,6108e41d-e9a5-446b-aced-3f075e47c638,626641ff-a212-4a20-a034-96c1cd9e8b63,,,https://snowplowanalytics.com/dbt-coalesce-data-at-scale-html-2021/,https://snowplowanalytics.com/wp-content/uploads/sites/3/2022/01/Modeling-event-data-at-scale-w_-Paul-Boocock-of-Snowplow-H6Q-dtQ7xdM.mp4,Devon,Firefox 9,Computer,Mac OS X,Europe/London,web,1887,video,org.whatwg-media_element,2022-01-18 12:11:12.690000000,2022-01-18 12:11:34.315000000,,,,1,,,,,true,false,false,,0.000,0.000,1.000,0.000,,
0677535575450bcdbbb41652e503cdd3,7b2539f5-6ea4-4625-81c2-04dc8ee950d6,ae9ad2ba4e69068fa1807c9f41d9235a,html-dbt,dbt Coalesce 2021 - Data modeling at Scale,f93e8a1e-1fa0-444d-bf13-9cc5c2eecb34,8386d9a2-fb0c-4567-b20a-a6c73c0d6e1c,,,https://snowplowanalytics.com/dbt-coalesce-data-at-scale-html-2021/,https://snowplowanalytics.com/wp-content/uploads/sites/3/2022/01/Modeling-event-data-at-scale-w_-Paul-Boocock-of-Snowplow-H6Q-dtQ7xdM.mp4,Staffordshire,Firefox 9,Computer,Mac OS X,Europe/London,web,1887,video,org.whatwg-media_element,2022-01-18 11:57:21.354000000,2022-01-18 11:57:22.504000000,,,,0,,,,,true,false,false,,0.000,0.000,1.000,0.000,,
01a156bb8313e33f1de0b8900cedf07f,ffae6eef-c255-4dea-918f-f793c716e117,ae9ad2ba4e69068fa1807c9f41d9235a,html-dbt,dbt Coalesce 2021 - Data modeling at Scale,f93e8a1e-1fa0-444d-bf13-9cc5c2eecb34,8386d9a2-fb0c-4567-b20a-a6c73c0d6e1c,,https://tagassistant.google.com/,https://snowplowanalytics.com/dbt-coalesce-data-at-scale-html-2021/?gtm_debug=1643370977451,https://snowplowanalytics.com/wp-content/uploads/sites/3/2022/01/Modeling-event-data-at-scale-w_-Paul-Boocock-of-Snowplow-H6Q-dtQ7xdM.mp4,Staffordshire,Firefox 9,Computer,Mac OS X,Europe/London,web,1887,video,org.whatwg-media_element,2022-01-18 11:56:27.815000000,2022-01-18 11:56:42.221000000,,,,1,,,,,true,true,false,100,472.000,0.000,1.000,0.000,,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
media_ad_id,platform,media_identifier,media_label,domain_userid,session_identifier,user_id,play_id,ad_break_id,ad_break_name,ad_break_type,ad_id,name,creative_id,duration_secs,pod_position,skippable,clicked,skipped,percent_reached_25,percent_reached_50,percent_reached_75,percent_reached_100,viewed_at,last_event
media_ad_id,platform,media_identifier,media_label,user_identifier,session_identifier,user_id,play_id,ad_break_id,ad_break_name,ad_break_type,ad_id,name,creative_id,duration_secs,pod_position,skippable,clicked,skipped,percent_reached_25,percent_reached_50,percent_reached_75,percent_reached_100,viewed_at,last_event
4d8f7edbf7172575c528d515864aef56,mob,12a63eafc0d70abcfc379a23ae9788e3,For bigger fun,403f1cce-bd79-1276-40c3-48c3d3ad3948,f408b333-9938-76af-9e34-d34b6c972cef,,9eaa0dfd-e97c-d84c-093a-4df583222cfc,342285bb-2a8c-adef-22f6-67eeb6a63732,break,linear,a825644f-3882-8dcc-5e20-c38007bbf5b4,Ad 1,ad-1,4,1,true,false,true,true,false,false,false,2022-10-08 13:47:37.043000000,2022-10-08 13:47:39.369000000
828fb17a4444393c01930e8ab54aa4a8,mob,12a63eafc0d70abcfc379a23ae9788e3,For bigger fun,71f59f48-2c65-9ddb-6f16-6781a07458f0,2782ceac-a287-f9d7-d9a7-82688894976d,,df668de4-9188-9408-1e62-67c1209745c8,7ce3c741-8413-5ea6-5aff-4726813cc236,break,linear,0c446fce-b41a-f88d-81b8-e73774bec5fe,Ad 2,ad-2,4,2,true,true,true,true,true,false,false,2022-10-08 11:09:05.102000000,2022-10-08 11:09:08.593000000
4d8f7edbf7172575c528d515864aef56,mob,12a63eafc0d70abcfc379a23ae9788e3,For bigger fun,403f1cce-bd79-1276-40c3-48c3d3ad3948,cbbcabcd-381a-7703-cbf5-143bcb7c4013,,446844e7-6dbd-4463-0b18-699df1a002b0,2ae78ec1-2599-c2a3-bf07-a10a81df6fba,break,linear,a825644f-3882-8dcc-5e20-c38007bbf5b4,Ad 1,ad-1,4,1,true,false,true,true,true,true,false,2022-10-08 14:59:43.813000000,2022-10-08 14:59:45.524000000
Expand Down
Loading

0 comments on commit 1ca6e6f

Please sign in to comment.