From 45d1130c1d6cd07d55a46b2b3073a9fd04d7930d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 23 Jul 2021 19:59:16 +0100 Subject: [PATCH 1/7] Updating package dependendcies --- packages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages.yml b/packages.yml index f583465..2561211 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ -packages: - - package: fivetran/linkedin_source - version: [">=0.2.0", "<0.3.0"] +packages: +- package: fivetran/linkedin_source + version: [">=0.4.0", "<0.5.0"] From b5c91059a8fbcd0b5cef26b58333329e6174c45a Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 23 Jul 2021 19:59:16 +0100 Subject: [PATCH 2/7] Updating require-dbt-version --- dbt_project.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 2308468..fcb9ce6 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,22 +1,18 @@ - name: 'linkedin' -version: '0.3.1' +version: '0.4.0' config-version: 2 -require-dbt-version: [">=0.18.0", "<0.20.0"] - +require-dbt-version: [">=0.20.0"] vars: - linkedin: - ad_analytics_by_creative: "{{ ref('stg_linkedin__ad_analytics_by_creative') }}" - creative_history: "{{ ref('stg_linkedin__creative_history') }}" - campaign_history: "{{ ref('stg_linkedin__campaign_history') }}" - campaign_group_history: "{{ ref('stg_linkedin__campaign_group_history') }}" - account_history: "{{ ref('stg_linkedin__account_history') }}" - dbt_utils_dispatch_list: ['spark_utils', 'fivetran_utils'] - fivetran_utils_dispatch_list: ['spark_utils'] - - linkedin__passthrough_metrics: [] - + linkedin: + ad_analytics_by_creative: "{{ ref('stg_linkedin__ad_analytics_by_creative') }}" + creative_history: "{{ ref('stg_linkedin__creative_history') }}" + campaign_history: "{{ ref('stg_linkedin__campaign_history') }}" + campaign_group_history: "{{ ref('stg_linkedin__campaign_group_history') }}" + account_history: "{{ ref('stg_linkedin__account_history') }}" + dbt_utils_dispatch_list: ['spark_utils', 'fivetran_utils'] + fivetran_utils_dispatch_list: ['spark_utils'] + linkedin__passthrough_metrics: [] models: - linkedin: - +materialized: table - +schema: linkedin + linkedin: + +materialized: table + +schema: linkedin From cc2f2bcd2a31a7f0349b40205a576c651dd0b5c8 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 23 Jul 2021 19:59:17 +0100 Subject: [PATCH 3/7] Updating dbt version in requirements.txt --- integration_tests/requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration_tests/requirements.txt b/integration_tests/requirements.txt index b0df5fe..b06ff52 100644 --- a/integration_tests/requirements.txt +++ b/integration_tests/requirements.txt @@ -1,3 +1,3 @@ -dbt==0.19.1 -dbt-spark==0.19.1 -dbt-spark[PyHive]==0.19.1 +dbt==0.20.0 +dbt-spark==0.20.0 +dbt-spark[PyHive]==0.20.0 From 4e3b1f02c409214f12bdf1515ab03a0cd360ba35 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 23 Jul 2021 19:59:49 +0100 Subject: [PATCH 4/7] Update dbt_project.yml --- integration_tests/dbt_project.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 87ed696..895928e 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -36,4 +36,7 @@ seeds: linkedin_creative_history_data: +column_types: created_time: timestamp - last_modified_time: timestamp \ No newline at end of file + last_modified_time: timestamp +dispatch: + - macro_namespace: dbt_utils + search_order: ['spark_utils', 'dbt_utils'] From 3cea550465870007b577cd0b8ed578f463f7f6c9 Mon Sep 17 00:00:00 2001 From: fivetran-joemarkiewicz Date: Tue, 27 Jul 2021 18:54:27 -0500 Subject: [PATCH 5/7] dbt 20 readme and minor edits --- README.md | 19 +++++++++++++++++++ dbt_project.yml | 2 -- integration_tests/dbt_project.yml | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e8e53ce..dca0365 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Apache License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![dbt logo and version](https://img.shields.io/static/v1?logo=dbt&label=dbt-version&message=0.20.x&color=orange) # LinkedIn Ad Analytics ([docs](https://fivetran-dbt-linkedin.netlify.app/#!/overview)) This package models LinkedIn Ad Analytics data from [Fivetran's connector](https://fivetran.com/docs/applications/linkedin-ads). It uses data in the format described by [this ERD](https://fivetran.com/docs/applications/linkedin-ads#schemainformation). @@ -18,6 +19,14 @@ This package contains transformation models, designed to work simultaneously wit ## Installation Instructions Check [dbt Hub](https://hub.getdbt.com/) for the latest installation instructions, or [read the dbt docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. +Include in your `packages.yml` + +```yaml +packages: + - package: fivetran/linkedin + version: [">=0.4.0", "<0.5.0"] +``` + ## Configuration By default, this package will look for your LinkedIn Ad Analytics data in the `linkedin_ads` 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 LinkedIn Ad Analytics data is, please add the following configuration to your `dbt_project.yml` file: @@ -81,6 +90,16 @@ on the best workflow for contributing to a package. ## Database Support This package has been tested on BigQuery, Snowflake, Redshift, Postgres, and Databricks. +### Databricks Dispatch Configuration +dbt `v0.20.0` introduced a new project-level dispatch configuration that enables an "override" setting for all dispatched macros. If you are using a Databricks destination with this package you will need to add the below (or a variation of the below) dispatch configuration within your `dbt_project.yml`. This is required in order for the package to accurately search for macros within the `dbt-labs/spark_utils` then the `dbt-labs/dbt_utils` packages respectively. +```yml +# dbt_project.yml + +dispatch: + - macro_namespace: dbt_utils + search_order: ['spark_utils', 'dbt_utils'] +``` + ## Resources: - Provide [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next - Have questions, feedback, or need help? Book a time during our office hours [using Calendly](https://calendly.com/fivetran-solutions-team/fivetran-solutions-team-office-hours) or email us at solutions@fivetran.com diff --git a/dbt_project.yml b/dbt_project.yml index fcb9ce6..b02fae4 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -9,8 +9,6 @@ vars: campaign_history: "{{ ref('stg_linkedin__campaign_history') }}" campaign_group_history: "{{ ref('stg_linkedin__campaign_group_history') }}" account_history: "{{ ref('stg_linkedin__account_history') }}" - dbt_utils_dispatch_list: ['spark_utils', 'fivetran_utils'] - fivetran_utils_dispatch_list: ['spark_utils'] linkedin__passthrough_metrics: [] models: linkedin: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 895928e..8759c9f 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'linkedin_integration_tests' -version: '0.3.1' +version: '0.4.0' profile: 'integration_tests' config-version: 2 From 3e9063006ac8f3138d6a58c27f57f44cfec0e865 Mon Sep 17 00:00:00 2001 From: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> Date: Tue, 27 Jul 2021 18:58:57 -0500 Subject: [PATCH 6/7] Apply suggestions from code review --- README.md | 2 +- packages.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dca0365..8805f2c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Include in your `packages.yml` ```yaml packages: - package: fivetran/linkedin - version: [">=0.4.0", "<0.5.0"] + version: [">=0.3.0", "<0.4.0"] ``` ## Configuration diff --git a/packages.yml b/packages.yml index 2561211..ab6a731 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - package: fivetran/linkedin_source - version: [">=0.4.0", "<0.5.0"] + version: [">=0.3.0", "<0.4.0"] From 0576549b9e4db3120c44a0ef49ecb5df0ae828b3 Mon Sep 17 00:00:00 2001 From: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:06:52 -0500 Subject: [PATCH 7/7] Apply suggestions from code review --- dbt_project.yml | 2 +- integration_tests/dbt_project.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index b02fae4..ba41439 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'linkedin' -version: '0.4.0' +version: '0.3.0' config-version: 2 require-dbt-version: [">=0.20.0"] vars: diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 8759c9f..d45987c 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'linkedin_integration_tests' -version: '0.4.0' +version: '0.3.0' profile: 'integration_tests' config-version: 2