Skip to content
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

review/jm-final #2

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .quickstart/quickstart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
database_key: salesforce_marketing_cloud_database
schema_key: salesforce_marketing_cloud_schema

dbt_versions: ">=1.3.0 <2.0.0"

table_variables:
salesforce_marketing_cloud__link_enabled:
- link_send
- link
salesforce_marketing_cloud__list_enabled:
- list_subscriber
- list

destination_configurations:
databricks:
dispatch:
- macro_namespace: dbt_utils
search_order: [ 'spark_utils', 'dbt_utils' ]
Comment on lines +1 to +18
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New addition of the quickstart.yml where the format was just finalized yesterday.

3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
This package models Salesforce Marketing Cloud data from [Fivetran's connector](https://fivetran.com/docs/applications/salesforce_marketing_cloud). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/salesforce_marketing_cloud#schemainformation).

The main focus of the package is to transform the core object tables into analytics-ready models:
<!--section="salesforce_marketing_cloud_model"-->
- Materializes [Salesforce Marketing Cloud staging tables](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/overview/salesforce_marketing_cloud_source/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/salesforce_marketing_cloud/#schemainformation). The staging tables clean, test, and prepare your Salesforce Marketing Cloud data from [Fivetran's connector](https://fivetran.com/docs/applications/salesforce_marketing_cloud_source) for analysis by doing the following:
- Materializes [Salesforce Marketing Cloud staging tables](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/overview/salesforce_marketing_cloud/models/?g_v=1) which leverage data in the format described by [this ERD](https://fivetran.com/docs/applications/salesforce_marketing_cloud/#schemainformation). The staging tables clean, test, and prepare your Salesforce Marketing Cloud data from [Fivetran's connector](https://fivetran.com/docs/applications/salesforce_marketing_cloud) for analysis by doing the following:
- Primary keys are renamed from `id` to `<table name>_id`.
- Adds column-level testing where applicable. For example, all primary keys are tested for uniqueness and non-null values.
- Provides insight into your Salesforce Marketing Cloud data across the following grains:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following table provides a detailed list of all models materialized within t
| **model** | **description**|
| --------- | -------------- |
| [salesforce_marketing_cloud__email_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__email_overview) | Each record provides the performance of an email via `total_*` and `*_rate` metrics. |
| [salesforce_marketing_cloud__events_enhanced](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__event_enhanced) | Each record expands the source events information by pivoting the `event_type` options into boolean fields. Each record also has related send and email information added. |
| [salesforce_marketing_cloud__events_enhanced](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__events_enhanced) | Each record expands the source events information by pivoting the `event_type` options into boolean fields. Each record also has related send and email information added. |
| [salesforce_marketing_cloud__sends_links](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_links) | Each record provides a link, joined with all corresponding send(s). |
| [salesforce_marketing_cloud__sends_overview](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__sends_overview) | Each record provides the performance of a send via `total_*` and `*_rate` metrics. |
| [salesforce_marketing_cloud__subscriber_lists](https://fivetran.github.io/dbt_salesforce_marketing_cloud/#!/model/model.salesforce_marketing_cloud.salesforce_marketing_cloud__subscriber_lists) | Each record provides a list, joined with all corresponding subscriber(s). |
Expand Down
2 changes: 1 addition & 1 deletion models/salesforce_marketing_cloud__subscriber_overview.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with subscribers as (
case when subscribers.unsubscribed_date is not null
then {{ dbt.datediff("subscribers.created_date", "subscribers.unsubscribed_date", "day") }}
else {{ dbt.datediff("subscribers.created_date", "current_date", "day") }}
end as days_subscribed,
end as days_subscribed,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small formatting edit to be consistent with our style standards.

sum(case when events_enhanced.is_sent then 1 else 0 end) as number_of_sends,
max(case when events_enhanced.is_sent then events_enhanced.event_date end) as most_recent_send,
sum(case when events_enhanced.is_open then 1 else 0 end) as number_of_opens,
Expand Down