Skip to content

Commit

Permalink
Align variable names to other packages
Browse files Browse the repository at this point in the history
  • Loading branch information
agnessnowplow committed Oct 17, 2023
1 parent 46b2bcb commit 2c113df
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ vars:
# add extra mobile fields:
snowplow__enable_mobile_context: false
snowplow__enable_geolocation_context: false
snowplow__enable_app_context: false
snowplow__enable_application_context: false
snowplow__enable_screen_context: false
snowplow__enable_deep_link_context: false
# add extra custom fields:
Expand Down Expand Up @@ -112,15 +112,15 @@ vars:
snowplow__iab_context: com_iab_snowplow_spiders_and_robots_1
snowplow__ua_parser_context: com_snowplowanalytics_snowplow_ua_parser_context_1
snowplow__yauaa_context: nl_basjes_yauaa_context_1
snowplow__cwv_context: unstruct_event_com_snowplowanalytics_snowplow_web_vitals_1
snowplow__cwv_context: com_snowplowanalytics_snowplow_web_vitals_1
snowplow__browser_context: com_snowplowanalytics_snowplow_browser_context_1
# mobile only contexts
snowplow__session_context: com_snowplowanalytics_snowplow_client_session_1
snowplow__mobile_context: com_snowplowanalytics_snowplow_mobile_context_1
snowplow__geolocation_context: com_snowplowanalytics_snowplow_geolocation_context_1
snowplow__application_context: com_snowplowanalytics_mobile_application_1
snowplow__screen_context: com_snowplowanalytics_mobile_screen_1
snowplow__app_errors_table: com_snowplowanalytics_snowplow_application_error_1
snowplow__app_errors_context: com_snowplowanalytics_snowplow_application_error_1
snowplow__screen_view_events: com_snowplowanalytics_mobile_screen_view_1
snowplow__deep_link_context: contexts_com_snowplowanalytics_mobile_deep_link_1

Expand Down
6 changes: 3 additions & 3 deletions integration_tests/.scripts/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ for db in ${DATABASES[@]}; do

echo "Snowplow unified integration tests: Late enabled contexts"

eval "dbt run --full-refresh --select +test_late_enabled_contexts snowplow_unified_integration_tests.source --vars '{snowplow__allow_refresh: true, snowplow__backfill_limit_days: 220, snowplow__enable_cwv: false, snowplow__enable_mobile_context: false, snowplow__enable_geolocation_context: false, snowplow__enable_app_context: false, snowplow__enable_screen_context: false, snowplow__enable_app_errors_module: false, snowplow__enable_deep_link_context: false, snowplow__enable_cwv: false, snowplow__enable_iab: false, snowplow__enable_ua: false, snowplow__enable_browser_context: false, snowplow__enable_consent: false}' --target $db" || exit 1;
eval "dbt run --full-refresh --select +test_late_enabled_contexts snowplow_unified_integration_tests.source --vars '{snowplow__allow_refresh: true, snowplow__backfill_limit_days: 220, snowplow__enable_cwv: false, snowplow__enable_mobile_context: false, snowplow__enable_geolocation_context: false, snowplow__enable_application_context: false, snowplow__enable_screen_context: false, snowplow__enable_app_errors_module: false, snowplow__enable_deep_link_context: false, snowplow__enable_cwv: false, snowplow__enable_iab: false, snowplow__enable_ua: false, snowplow__enable_browser_context: false, snowplow__enable_consent: false}' --target $db" || exit 1;

eval "dbt run --select +test_late_enabled_contexts run --vars '{snowplow__allow_refresh: true, snowplow__backfill_limit_days: 250, snowplow__enable_cwv: false}' --target $db"

Expand All @@ -58,13 +58,13 @@ for db in ${DATABASES[@]}; do

echo "Snowplow unified integration tests - Core Web Vitals: Execute models"

eval "dbt run --select +snowplow_unified_web_vital_measurements_actual snowplow_unified_web_vital_measurements_expected_stg source --full-refresh --vars '{snowplow__allow_refresh: true, snowplow__start_date: '2023-03-01', snowplow__backfill_limit_days: 50, snowplow__cwv_days_to_measure: 999, snowplow__enable_mobile: false, snowplow__enable_mobile_context: false, snowplow__enable_geolocation_context: false, snowplow__enable_app_context: false, snowplow__enable_screen_context: false, snowplow__enable_app_errors_module: false, snowplow__enable_deep_link_context: false, snowplow__enable_ua: false, snowplow__enable_browser_context: false, snowplow__enable_consent: false}' --target $db" || exit 1;
eval "dbt run --select +snowplow_unified_web_vital_measurements_actual snowplow_unified_web_vital_measurements_expected_stg source --full-refresh --vars '{snowplow__allow_refresh: true, snowplow__start_date: '2023-03-01', snowplow__backfill_limit_days: 50, snowplow__cwv_days_to_measure: 999, snowplow__enable_mobile: false, snowplow__enable_mobile_context: false, snowplow__enable_geolocation_context: false, snowplow__enable_application_context: false, snowplow__enable_screen_context: false, snowplow__enable_app_errors_module: false, snowplow__enable_deep_link_context: false, snowplow__enable_ua: false, snowplow__enable_browser_context: false, snowplow__enable_consent: false}' --target $db" || exit 1;

eval "dbt test --select snowplow_unified_web_vital_measurements_actual --store-failures --target $db" || exit 1;

echo "Snowplow unified integration tests: Execute web (all web contexts except for cwv)"

eval "dbt run --full-refresh --vars '{snowplow__allow_refresh: true, snowplow__backfill_limit_days: 9999, snowplow__enable_mobile: false, snowplow__enable_mobile_context: false, snowplow__enable_geolocation_context: false, snowplow__enable_app_context: false, snowplow__enable_screen_context: false, snowplow__enable_app_errors_module: false, snowplow__enable_deep_link_context: false, snowplow__enable_cwv: false}' --select +snowplow_unified_users snowplow_unified_events_stg --target $db" || exit 1;
eval "dbt run --full-refresh --vars '{snowplow__allow_refresh: true, snowplow__backfill_limit_days: 9999, snowplow__enable_mobile: false, snowplow__enable_mobile_context: false, snowplow__enable_geolocation_context: false, snowplow__enable_application_context: false, snowplow__enable_screen_context: false, snowplow__enable_app_errors_module: false, snowplow__enable_deep_link_context: false, snowplow__enable_cwv: false}' --select +snowplow_unified_users snowplow_unified_events_stg --target $db" || exit 1;

echo "Snowplow unified integration tests: Execute mobile (all mobile contexts)"

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ vars:
snowplow__application_context: snowplow_unified_app_context_stg
snowplow__screen_context: snowplow_unified_screen_context_stg
snowplow__deep_link_context: snowplow_unified_deep_link_context_stg
snowplow__app_errors_table: snowplow_unified_app_error_event_stg
snowplow__app_errors_context: snowplow_unified_app_error_event_stg

snowplow__start_date: "2020-07-03"
snowplow__backfill_limit_days: 2
Expand All @@ -83,7 +83,7 @@ vars:
# add extra mobile fields:
snowplow__enable_mobile_context: true
snowplow__enable_geolocation_context: true
snowplow__enable_app_context: true
snowplow__enable_application_context: true
snowplow__enable_screen_context: true
snowplow__enable_app_errors_module: true
snowplow__enable_deep_link_context: true
Expand Down
2 changes: 1 addition & 1 deletion macros/config_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{{ exceptions.raise_compiler_error(
"Snowplow Error: Geolocation context is enabled but it cannot be processed as `snowplow__enable_mobile` is currently disabled."
) }}
{% elif var('snowplow__enable_app_context') %}
{% elif var('snowplow__enable_application_context') %}
{{ exceptions.raise_compiler_error(
"Snowplow Error: App context is enabled but it cannot be processed as `snowplow__enable_mobile` is currently disabled."
) }}
Expand Down
10 changes: 5 additions & 5 deletions macros/field_extractions/get_app_context_fields.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{%- endmacro -%}

{% macro postgres__get_app_context_fields() %}
{% if var('snowplow__enable_app_context', false) %}
{% if var('snowplow__enable_application_context', false) %}
{% else %}
, cast(null as {{ snowplow_utils.type_max_string() }}) as app__build
, cast(null as {{ snowplow_utils.type_max_string() }}) as app__version
Expand All @@ -24,9 +24,9 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{'field':('version', 'app__version'), 'dtype':'string'}
] %}

{% if var('snowplow__enable_app_context', false) %}
{% if var('snowplow__enable_application_context', false) %}
, {{ snowplow_utils.get_optional_fields(
enabled=var('snowplow__enable_app_context', false),
enabled=var('snowplow__enable_application_context', false),
col_prefix='contexts_com_snowplowanalytics_mobile_application_1',
fields=bq_app_context_fields,
relation=source('atomic', 'events') if project_name != 'snowplow_unified_integration_tests' else ref('snowplow_unified_events_stg'),
Expand All @@ -38,7 +38,7 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{% endmacro %}

{% macro spark__get_app_context_fields() %}
{% if var('snowplow__enable_app_context', false) %}
{% if var('snowplow__enable_application_context', false) %}
, contexts_com_snowplowanalytics_mobile_application_1[0].build::STRING AS app__build
, contexts_com_snowplowanalytics_mobile_application_1[0].version::STRING AS app__version
{% else %}
Expand All @@ -48,7 +48,7 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{% endmacro %}

{% macro snowflake__get_app_context_fields() %}
{% if var('snowplow__enable_app_context', false) %}
{% if var('snowplow__enable_application_context', false) %}
, contexts_com_snowplowanalytics_mobile_application_1[0]:build::varchar(255) AS app__build
, contexts_com_snowplowanalytics_mobile_application_1[0]:version::varchar(255) AS app__version
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions models/base/scratch/snowplow_unified_base_events_this_run.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{% do contexts.append({'schema': var('snowplow__geolocation_context'), 'prefix': 'geo_', 'single_entity': True}) %}
{% endif -%}

{% if var('snowplow__enable_app_context', false) -%}
{% if var('snowplow__enable_application_context', false) -%}
{% do contexts.append({'schema': var('snowplow__application_context'), 'prefix': 'app_', 'single_entity': True}) %}
{% endif -%}

Expand All @@ -65,7 +65,7 @@ You may obtain a copy of the Snowplow Community License Version 1.0 at https://d
{% endif -%}

{% if var('snowplow__enable_app_errors_module', false) -%}
{% do contexts.append({'schema': var('snowplow__app_errors_table'), 'prefix': 'app_error_', 'single_entity': True}) %}
{% do contexts.append({'schema': var('snowplow__app_errors_context'), 'prefix': 'app_error_', 'single_entity': True}) %}
{% endif -%}

{% if var('snowplow__enable_deep_link_context', false) -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ with session_firsts as (
{{ ua_context_fields('ev') }}
{% endif %}

{% if var('snowplow__enable_app_context') %}
{% if var('snowplow__enable_application_context') %}
{{ app_context_fields('ev') }}
{% endif %}

Expand Down Expand Up @@ -405,7 +405,7 @@ select

{% endif %}

{% if var('snowplow__enable_app_context') %}
{% if var('snowplow__enable_application_context') %}
, f.app__build as first_app__build
, f.app__version as first_app__version
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions models/views/scratch/snowplow_unified_views_this_run.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ with prep as (
{{ ua_context_fields('ev') }}
{% endif %}

{% if var('snowplow__enable_app_context') %}
{% if var('snowplow__enable_application_context') %}
{{ app_context_fields('ev') }}
{% endif %}

Expand Down Expand Up @@ -308,7 +308,7 @@ select
, pve.screen_view__type
{% endif %}

{% if var('snowplow__enable_app_context') %}
{% if var('snowplow__enable_application_context') %}
, pve.app__build
, pve.app__version
{% endif %}
Expand Down

0 comments on commit 2c113df

Please sign in to comment.