-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix for events incremental #51
Changes from 16 commits
cf4ef97
c59f8d5
ed87003
c438cb7
21f080e
88ebc6f
23e9078
6e8cd2c
1c57bd0
6a55ec5
329642c
a397489
ad21bec
e446d71
350b9c9
f0bb24e
f6699c9
2100686
bbb79f6
f26b05c
90a305f
bf2a4a4
2c032bc
a316934
c91f5dc
d168b36
c0ea5e9
4224134
73656ec
e6ff0fa
a38124f
04f1d87
d9b5c0e
59b28e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ Include the following Iterable package version in your `packages.yml` file. | |
```yaml | ||
packages: | ||
- package: fivetran/iterable | ||
version: [">=0.12.0", "<0.13.0"] | ||
version: [">=0.13.0", "<0.14.0"] | ||
``` | ||
### Step 3: Define database and schema variables | ||
By default, this package runs using your destination and the `iterable` schema of your [target database](https://docs.getdbt.com/docs/running-a-dbt-project/using-the-command-line-interface/configure-your-profile). If this is not where your Iterable data is located (for example, if your Iterable schema is named `iterable_fivetran`), add the following configuration to your root `dbt_project.yml` file: | ||
|
@@ -158,6 +158,28 @@ If an individual source table has a different name than what the package expects | |
vars: | ||
iterable_<default_source_table_name>_identifier: "your_table_name" | ||
``` | ||
|
||
#### Pivoting out event metrics | ||
In the `iterable__user_campaign` model, there are metrics calculated based on Iterable events. By default, all event metrics are enabled as shown in the [`dbt_project.yml`](https://github.com/fivetran/dbt_iterable/blob/2c0c1764f55af255726397a374b48004de20cf51/dbt_project.yml#L34). If not all metrics apply to your use case, you can specify which event metrics to include by configuring the variable `iterable__event_metrics` in your own `dbt_project.yml` as shown below. | ||
|
||
```yml | ||
vars: | ||
iterable__event_metrics: | ||
- "emailSend" | ||
- "emailOpen" | ||
``` | ||
fivetran-reneeli marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This ending codeblock was not captured before. It seems the suggestion didn't like the ending codeblock in a codeblock. I just committed this directly to your branch to address the issue. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh gotcha, thank you! |
||
|
||
#### Lookback Window | ||
Records from the source can sometimes arrive late. Since several of the models in this package are incremental, by default we look back 7 days to ensure late arrivals are captured while avoiding the need for frequent full refreshes. While the frequency can be reduced, we still recommend running `dbt --full-refresh` periodically to maintain data quality of the models. | ||
|
||
To change the default lookback window, add the following variable to your `dbt_project.yml` file: | ||
|
||
```yml | ||
vars: | ||
iterable: | ||
lookback_window: number_of_days # default is 7 | ||
``` | ||
|
||
#### Deprecated `CAMPAIGN_SUPRESSION_LIST_HISTORY` table | ||
|
||
The Iterable connector schema originally misspelled the `CAMPAIGN_SUPPRESSION_LIST_HISTORY` table as `CAMPAIGN_SUPRESSION_LIST_HISTORY` (note the singular `P`). As of August 2021, Fivetran has deprecated the misspelled table and will only continue syncing the correctly named `CAMPAIGN_SUPPRESSION_LIST_HISTORY` table. | ||
|
@@ -170,11 +192,8 @@ vars: | |
``` | ||
|
||
### (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™ | ||
<details><summary>Expand for details</summary> | ||
<br> | ||
|
||
|
||
Fivetran offers the ability for you to orchestrate your dbt project through [Fivetran Transformations for dbt Core™](https://fivetran.com/docs/transformations/dbt). Learn how to set up your project for orchestration through Fivetran in our [Transformations for dbt Core setup guides](https://fivetran.com/docs/transformations/dbt#setupguide). | ||
</details> | ||
|
||
## Does this package have dependencies? | ||
This dbt package is dependent on the following dbt packages. These dependencies are installed by default within this package. For more information on the following packages, refer to the [dbt hub](https://hub.getdbt.com/) site. | ||
|
@@ -189,7 +208,7 @@ packages: | |
version: [">=1.0.0", "<2.0.0"] | ||
|
||
- package: fivetran/iterable_source | ||
version: [">=0.9.0", "<0.10.0"] | ||
version: [">=0.10.0", "<0.11.0"] | ||
``` | ||
|
||
## How is this package maintained and can I contribute? | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fivetran-reneeli We should probably have the seed files match on both source and transform packages. Can you update one or the other? Not sure what works best here for more robust testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @fivetran-avinash , I believe they're the same now |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{% macro iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %} | ||
|
||
{{ adapter.dispatch('iterable_lookback', 'iterable') (from_date, datepart, interval, safety_date='2020-01-01') }} | ||
|
||
{%- endmacro %} | ||
|
||
{% macro default__iterable_lookback(from_date, datepart, interval, safety_date='2020-01-01') %} | ||
|
||
{% set sql_statement %} | ||
select coalesce({{ from_date }}, {{ "'" ~ safety_date ~ "'" }}) | ||
from {{ this }} | ||
{%- endset -%} | ||
|
||
{%- set result = dbt_utils.get_single_value(sql_statement) %} | ||
|
||
{{ dbt.dateadd(datepart=datepart, interval=-interval, from_date_or_timestamp="cast('" ~ result ~ "' as date)") }} | ||
|
||
{% endmacro %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
packages: | ||
- package: fivetran/iterable_source | ||
version: [">=0.9.0", "<0.10.0"] | ||
# - package: fivetran/iterable_source | ||
# version: [">=0.10.0", "<0.11.0"] | ||
|
||
- git: https://github.com/fivetran/dbt_iterable_source.git | ||
revision: rm_src_freshness | ||
warn-unpinned: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder to swap before merge There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated