Skip to content

Commit

Permalink
Merge pull request #31 from fivetran/add_event_extension_table_disable
Browse files Browse the repository at this point in the history
add event_extension var
  • Loading branch information
fivetran-reneeli authored Jul 25, 2024
2 parents 1bda010 + 1497112 commit d0a989e
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ dbt deps
dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --vars '{iterable__using_campaign_label_history: false, iterable__using_user_unsubscribed_message_type_history: false, iterable__using_campaign_suppression_list_history: false}' --full-refresh --target "$db"
dbt run --vars '{iterable_user_history_pass_through_columns: [{name: "phone_number_updated_at"}], iterable_event_extension_pass_through_columns: [{name: "web_push_message"}]}' --full-refresh --target "$db"
dbt run --vars '{iterable__using_campaign_label_history: false, iterable__using_user_unsubscribed_message_type_history: false, iterable__using_campaign_suppression_list_history: false, iterable__using_event_extension: false}' --full-refresh --target "$db"
dbt run --vars '{ does_table_exist('user_unsubscribed_message_type'): false, does_table_exist('user_unsubscribed_channel'): false}' --full-refresh --target "$db"
dbt test --target "$db"
dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# dbt_iterable_source v0.9.0
[PR #31](https://github.com/fivetran/dbt_iterable_source/pull/31) contains the following updates:

## 🚨 Breaking Changes 🚨
- Introduces variable `iterable__using_event_extension` to disable the `stg_iterable__event_extension` model. This allows the downstream models to run even if the source `event_extension` table does not exist. For more information on how to configure refer to the [README](https://github.com/fivetran/dbt_iterable_source/blob/main/README.md#step-4-enablingdisabling-models).

# dbt_iterable_source v0.8.1
[PR #30](https://github.com/fivetran/dbt_iterable_source/pull/30) introduces the following updates:

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Include the following Iterable package version in your `packages.yml` file.
```yaml
packages:
- package: fivetran/iterable_source
version: [">=0.8.0", "<0.9.0"]
version: [">=0.9.0", "<0.10.0"]
```
## Step 3: Define database and schema variables
Expand All @@ -65,6 +65,7 @@ vars:
iterable__using_campaign_label_history: false # default is true
iterable__using_user_unsubscribed_message_type: false # default is true
iterable__using_campaign_suppression_list_history: false # default is true
iterable__using_event_extension: false # default is true
```

Expand All @@ -75,7 +76,7 @@ vars:

### Passing Through Additional Fields

This package includes fields we judged were standard across Iterable users. However, the Fivetran connector allows for additional columns to be brought through in the `event_extension` and `user_history` objects. Therefore, if you wish to bring them through, leverage our passthrough column variables.
This package includes fields we judged were standard across Iterable users. However, the Fivetran connector allows for additional columns to be brought through in the `event_extension` and `user_history` objects. Therefore, if you wish to bring them through, leverage our passthrough column variables. For `event_extension` columns, ensure that `iterable__using_event_extension` is set to True, which is the default.

**Notice**: A `dbt run --full-refresh` is required each time these variables are edited.

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
name: 'iterable_source'

version: '0.8.1'
version: '0.9.0'
require-dbt-version: [">=1.3.0", "<2.0.0"]

models:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ integration_tests:
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
port: 5439
schema: iterable_source_integration_tests_4
schema: iterable_source_integration_tests_8
threads: 8
bigquery:
type: bigquery
method: service-account-json
project: 'dbt-package-testing'
schema: iterable_source_integration_tests_4
schema: iterable_source_integration_tests_8
threads: 8
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
snowflake:
Expand All @@ -33,7 +33,7 @@ integration_tests:
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
schema: iterable_source_integration_tests_4
schema: iterable_source_integration_tests_8
threads: 8
postgres:
type: postgres
Expand All @@ -42,13 +42,13 @@ integration_tests:
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
port: 5432
schema: iterable_source_integration_tests_4
schema: iterable_source_integration_tests_8
threads: 8
databricks:
catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
schema: iterable_source_integration_tests_4
schema: iterable_source_integration_tests_8
threads: 8
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
type: databricks
4 changes: 2 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
config-version: 2
name: 'iterable_source_integration_tests'

version: '0.8.1'
version: '0.9.0'
profile: 'integration_tests'

vars:
iterable_source:
iterable_schema: iterable_source_integration_tests_4
iterable_schema: iterable_source_integration_tests_8
iterable_campaign_history_identifier: "campaign_history_data"
iterable_campaign_label_history_identifier: "campaign_label_history_data"
iterable_campaign_list_history_identifier: "campaign_list_history_data"
Expand Down
2 changes: 2 additions & 0 deletions models/src_iterable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ sources:
- name: event_extension
identifier: "{{ var('iterable_event_extension_identifier', 'event_extension')}}"
description: Table containing additional properties from the event table.
config:
enabled: "{{ var('iterable__using_event_extension', true) }}"
columns:
- name: _fivetran_id
description: A Fivetran-created unique identifier derived from hashing campaign_id, created_at, and event_name.
Expand Down
7 changes: 4 additions & 3 deletions models/stg_iterable__event_extension.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{
config( materialized='view' )
}}
{{ config(
enabled=var('iterable__using_event_extension', True),
materialized='view'
) }}

with base as (

Expand Down
2 changes: 2 additions & 0 deletions models/tmp/stg_iterable__event_extension_tmp.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{{ config(enabled=var('iterable__using_event_extension', True)) }}

select *
from {{ var('event_extension') }}

0 comments on commit d0a989e

Please sign in to comment.