Skip to content

Commit 1898b85

Browse files
Merge pull request #66 from fivetran/MagicBot/dbt-utils-cross-db-migration
Updates for dbt-utils to dbt-core cross-db macro migration
2 parents 936ca7a + e4b65f8 commit 1898b85

14 files changed

+2848
-2777
lines changed

CHANGELOG.md

+54
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
# dbt_ad_reporting v1.1.0
2+
3+
## 🚨 Breaking Changes 🚨:
4+
[PR #66](https://github.com/fivetran/dbt_ad_reporting/pull/66) includes the following breaking changes:
5+
- Dispatch update for dbt-utils to dbt-core cross-db macros migration. Specifically `{{ dbt_utils.<macro> }}` have been updated to `{{ dbt.<macro> }}` for the below macros:
6+
- `any_value`
7+
- `bool_or`
8+
- `cast_bool_to_text`
9+
- `concat`
10+
- `date_trunc`
11+
- `dateadd`
12+
- `datediff`
13+
- `escape_single_quotes`
14+
- `except`
15+
- `hash`
16+
- `intersect`
17+
- `last_day`
18+
- `length`
19+
- `listagg`
20+
- `position`
21+
- `replace`
22+
- `right`
23+
- `safe_cast`
24+
- `split_part`
25+
- `string_literal`
26+
- `type_bigint`
27+
- `type_float`
28+
- `type_int`
29+
- `type_numeric`
30+
- `type_string`
31+
- `type_timestamp`
32+
- `array_append`
33+
- `array_concat`
34+
- `array_construct`
35+
- For `current_timestamp` and `current_timestamp_in_utc` macros, the dispatch AND the macro names have been updated to the below, respectively:
36+
- `dbt.current_timestamp_backcompat`
37+
- `dbt.current_timestamp_in_utc_backcompat`
38+
- `dbt_utils.surrogate_key` has also been updated to `dbt_utils.generate_surrogate_key`. Since the method for creating surrogate keys differ, we suggest all users do a `full-refresh` for the most accurate data. For more information, please refer to dbt-utils [release notes](https://github.com/dbt-labs/dbt-utils/releases) for this update.
39+
- Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`.
40+
- Metric attirbutes have been renamed to be consistent with the latest version of dbt-metrics: `sql` -> `expression` and `type` -> `calculation_method`
41+
42+
## 🎉 Features 🎉
43+
- Added ability for a user to allow records having nulls in url fields to be included in the `ad_reporting__url_report` and the underlying `*url_report` models. This is done by setting the below variable to `False` in your `dbt_project.yml` file. ([#72](https://github.com/fivetran/dbt_ad_reporting/pull/72))
44+
45+
```yml
46+
vars:
47+
ad_reporting__url_report__using_null_filter: False # Use this variable to include null urls for ALL upstream ad platform packages enabled in your project. Default is True.
48+
```
49+
- Updated README with this information. ([#72](https://github.com/fivetran/dbt_ad_reporting/pull/72))
50+
51+
## 🚘 Under the Hood 🚘
52+
- Disabled the `not_null` test for `ad_reporting__url_report` when null urls are allowed. ([#72](https://github.com/fivetran/dbt_ad_reporting/pull/72))
53+
- Updated this package's `integration_tests/seeds/microsoft_ads_campaign_performance_daily_report_data` in light of [PR #23](https://github.com/fivetran/dbt_microsoft_ads_source/pull/23) on `dbt_microsoft_ads_source`.([#68](https://github.com/fivetran/dbt_ad_reporting/pull/68))
54+
155
# dbt_ad_reporting v1.0.4
256
## Feature Enhancement
357
- The `keyword_id` field (which is a surrogate key generated from the combination of 'account_id', 'line_item_id', 'segment', and 'placement' fields within the Twitter Ads source) has been added to the `ad_reporting__keyword_report` model for the Twitter Ads platform. ([#71](https://github.com/fivetran/dbt_ad_reporting/pull/71))

README.md

+21-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
href="https://github.com/fivetran/dbt_github/blob/main/LICENSE">
44
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
55
<a alt="dbt-core">
6-
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.0.0_<2.0.0-orange.svg" /></a>
6+
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_<2.0.0-orange.svg" /></a>
77
<a alt="Maintained?">
88
<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /></a>
99
<a alt="PRs">
@@ -53,16 +53,25 @@ Refer to the table below for a detailed view of final models materialized by def
5353
- [TikTok Ads](https://fivetran.com/docs/applications/tiktok-ads)
5454
- [Twitter Ads](https://fivetran.com/docs/applications/twitter-ads)
5555
- **Database support**: This package has been tested on **BigQuery**, **Snowflake**, **Redshift**, **Postgres** and **Databricks**. Ensure you are using one of these supported databases.
56-
- **dbt Version**: This dbt package requires you have a functional dbt project that utilizes a dbt version within the respective range `>=1.0.0, <2.0.0`.
57-
- For Facebook Ads compatibility, please ensure that you have configured the necessary pre-built reports. Please refer to the [Facebook Ads package](https://github.com/fivetran/dbt_facebook_ads/tree/main#step-1-prerequisites) for more information.
56+
57+
### Databricks Dispatch Configuration
58+
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` as well as the `calogica/dbt_expectations` then the `google_ads_source` packages respectively.
59+
```yml
60+
dispatch:
61+
- macro_namespace: dbt_utils
62+
search_order: ['spark_utils', 'dbt_utils']
63+
64+
- macro_namespace: dbt_expectations
65+
search_order: ['google_ads_source', 'dbt_expectations']
66+
```
5867
5968
## Step 2: Installing the Package
6069
Include the following github package version in your `packages.yml`
6170
> 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.
6271
```yaml
6372
packages:
6473
- package: fivetran/ad_reporting
65-
version: [">=1.0.0", "<1.1.0"]
74+
version: [">=1.1.0", "<1.2.0"]
6675
```
6776
## Step 3: Configure Database and Schema Variables
6877
By default, this package looks for your ad platform data in your target database. If this is not where your app platform data is stored, add the relevant `<connector>_database` variables to your `dbt_project.yml` file (see below).
@@ -188,6 +197,14 @@ models:
188197
<details><summary>Expand for details</summary>
189198
<br>
190199

200+
## Disabling null URL filtering from URL reports
201+
The default behavior for the `ad_reporting__url_report` end model is to filter out records having null URL fields, however, you are able to turn off this filter if needed. To turn off the filter, include the below in your `dbt_project.yml` file. This variable will affect ALL Fivetran platform packages enabled in Ad Reporting, therefore either all URL reports will have null URLs filtered, or all URL reports will have null URLs included.
202+
203+
```yml
204+
vars:
205+
ad_reporting__url_report__using_null_filter: False # Default is True.
206+
```
207+
191208
### Change the source table references
192209
If an individual source table has a different name than the package expects, add the table name as it appears in your destination to the respective variable:
193210
> IMPORTANT: See the Apple Store [`dbt_project.yml`](https://github.com/fivetran/dbt_apple_store_source/blob/main/dbt_project.yml) and Google Play [`dbt_project.yml`](https://github.com/fivetran/dbt_google_play_source/blob/main/dbt_project.yml) variable declarations to see the expected names.

dbt_project.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: 'ad_reporting'
2-
version: '1.0.4'
2+
version: '1.1.0'
3+
34
config-version: 2
45

5-
require-dbt-version: [">=1.0.0", "<2.0.0"]
6+
require-dbt-version: [">=1.3.0", "<2.0.0"]
67

78
models:
89
ad_reporting:

docs/catalog.json

+1-1
Large diffs are not rendered by default.

docs/manifest.json

+1-1
Large diffs are not rendered by default.

docs/run_results.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)