Skip to content

Commit 16560b4

Browse files
Merge pull request #14 from fivetran/MagicBot/dbt-utils-cross-db-migration
Updates for dbt-utils to dbt-core cross-db macro migration
2 parents 284ebd1 + c086c86 commit 16560b4

13 files changed

Lines changed: 86 additions & 34 deletions

File tree

.buildkite/scripts/run_models.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ dbt deps
1919
dbt seed --target "$db" --full-refresh
2020
dbt run --target "$db" --full-refresh
2121
dbt test --target "$db"
22-
dbt run --vars '{twitter_ads__using_keywords: False}' --target "$db" --full-refresh
23-
dbt test --target "$db"
22+
dbt run --vars '{twitter_ads__using_keywords: false, ad_reporting__url_report__using_null_filter: false}' --target "$db" --full-refresh
23+
dbt test --vars '{twitter_ads__using_keywords: false, ad_reporting__url_report__using_null_filter: false}' --target "$db"

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
# dbt_twitter v0.6.0
2+
3+
## 🚨 Breaking Changes 🚨:
4+
[PR #14](https://github.com/fivetran/dbt_twitter/pull/14) 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+
- Dependencies on `fivetran/fivetran_utils` have been upgraded, previously `[">=0.3.0", "<0.4.0"]` now `[">=0.4.0", "<0.5.0"]`.
39+
40+
## 🎉 Features 🎉
41+
- For use in the [dbt_ad_reporting package](https://github.com/fivetran/dbt_ad_reporting), users can now allow records having nulls in url fields to be included in the `ad_reporting__url_report` model. See the [dbt_ad_reporting README](https://github.com/fivetran/dbt_ad_reporting) for more details. [#17](https://github.com/fivetran/dbt_twitter/pull/17)
42+
## 🚘 Under the Hood 🚘
43+
- Disabled the `not_null` test for `twitter_ads__url_report` when null urls are allowed. [#17](https://github.com/fivetran/dbt_twitter/pull/17)
44+
145
# dbt_twitter v0.5.1
246
## Fixes
347
- Fix the package name in the README ([#16](https://github.com/fivetran/dbt_twitter/pull/16))

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
href="https://github.com/fivetran/dbt_twitter/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">
@@ -52,7 +52,7 @@ Include the following Twitter package version in your `packages.yml` file:
5252
# packages.yml
5353
packages:
5454
- package: fivetran/twitter_ads
55-
version: [">=0.5.0", "<0.6.0"]
55+
version: [">=0.6.0", "<0.7.0"]
5656
```
5757

5858
## Step 3: Define database and schema variables
@@ -133,11 +133,13 @@ This dbt package is dependent on the following dbt packages. Please be aware tha
133133
```yml
134134
packages:
135135
- package: fivetran/twitter_source
136-
version: [">=0.5.0", "<0.6.0"]
136+
version: [">=0.6.0", "<0.7.0"]
137137
- package: fivetran/fivetran_utils
138-
version: [">=0.3.0", "<0.4.0"]
138+
version: [">=0.4.0", "<0.5.0"]
139139
- package: dbt-labs/dbt_utils
140-
version: [">=0.8.0", "<0.9.0"]
140+
version: [">=1.0.0", "<2.0.0"]
141+
- package: dbt-labs/spark_utils
142+
version: [">=0.3.0", "<0.4.0"]
141143
```
142144

143145
# 🙌 How is this package maintained and can I contribute?

dbt_project.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: 'twitter_ads'
2-
version: '0.5.1'
2+
version: '0.6.0'
33
config-version: 2
4-
require-dbt-version: [">=1.0.0", "<2.0.0"]
5-
4+
require-dbt-version: [">=1.3.0", "<2.0.0"]
65
models:
76
twitter_ads:
87
+schema: twitter_ads
98
+materialized: table
10-
119
vars:
1210
twitter_ads:
1311
line_item_history: "{{ ref('stg_twitter_ads__line_item_history') }}"
@@ -20,9 +18,7 @@ vars:
2018
campaign_report: "{{ ref('stg_twitter_ads__campaign_report') }}"
2119
line_item_report: "{{ ref('stg_twitter_ads__line_item_report') }}"
2220
line_item_keywords_report: "{{ ref('stg_twitter_ads__line_item_keywords_report') }}"
23-
2421
twitter_ads__campaign_report_passthrough_metrics: []
2522
twitter_ads__line_item_report_passthrough_metrics: []
2623
twitter_ads__line_item_keywords_report_passthrough_metrics: []
2724
twitter_ads__promoted_tweet_report_passthrough_metrics: []
28-

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/run_results.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

integration_tests/ci/sample.profiles.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ integration_tests:
1616
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
1717
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
1818
port: 5439
19-
schema: twitter_ads_integration_tests
19+
schema: twitter_ads_integration_tests_3
2020
threads: 8
2121
bigquery:
2222
type: bigquery
2323
method: service-account-json
2424
project: 'dbt-package-testing'
25-
schema: twitter_ads_integration_tests
25+
schema: twitter_ads_integration_tests_3
2626
threads: 8
2727
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
2828
snowflake:
@@ -33,7 +33,7 @@ integration_tests:
3333
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
3434
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
3535
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
36-
schema: twitter_ads_integration_tests
36+
schema: twitter_ads_integration_tests_3
3737
threads: 8
3838
postgres:
3939
type: postgres
@@ -42,13 +42,13 @@ integration_tests:
4242
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
4343
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
4444
port: 5432
45-
schema: twitter_ads_integration_tests
45+
schema: twitter_ads_integration_tests_3
4646
threads: 8
4747
databricks:
4848
catalog: null
4949
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
5050
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
51-
schema: twitter_ads_integration_tests
51+
schema: twitter_ads_integration_tests_3
5252
threads: 2
5353
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
5454
type: databricks

integration_tests/dbt_project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: 'twitter_integration_tests'
2-
version: '0.5.1'
2+
version: '0.6.0'
33
profile: 'integration_tests'
44
config-version: 2
55
snapshot-paths: ["snapshots"]
66

77
vars:
88
twitter_ads_source:
9-
twitter_ads_schema: twitter_ads_integration_tests
9+
twitter_ads_schema: twitter_ads_integration_tests_3
1010

1111
twitter_ads_account_history_identifier: "twitter_account_history_data"
1212
twitter_ads_campaign_history_identifier: "twitter_campaign_history_data"

integration_tests/requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
dbt-snowflake>=1.0.0,<1.3.0
2-
dbt-bigquery>=1.0.0,<1.3.0
3-
dbt-redshift>=1.0.0,<1.3.0
4-
dbt-postgres>=1.0.0,<1.3.0
5-
dbt-spark>=1.0.0,<1.3.0
6-
dbt-spark[PyHive]>=1.0.0,<1.3.0
7-
dbt-databricks>=1.0.0,<1.3.0
1+
dbt-snowflake>=1.3.0,<2.0.0
2+
dbt-bigquery>=1.3.0,<2.0.0
3+
dbt-redshift>=1.3.0,<2.0.0
4+
dbt-postgres>=1.3.0,<2.0.0
5+
dbt-spark>=1.3.0,<2.0.0
6+
dbt-spark[PyHive]>=1.3.0,<2.0.0
7+
dbt-databricks>=1.3.0,<2.0.0

0 commit comments

Comments
 (0)