Skip to content

Commit 549777a

Browse files
fivetran-data-model-botfivetran-catfritzfivetran-avinashgithub-actions[bot]
authored
Consolidate source + remove tests (#28)
* Consolidate dbt source into transform * Delete models/staging/docs.md * Update dbt_project.yml * Q2 FY26 Automatic Package Updates (#24) * Q2 FY26: Apply automated update. * Update .gitignore * Update generate-docs.yml * Q2 FY26: Update auto-release workflow only. --------- Co-authored-by: Avinash Kunnath <[email protected]> * Manual script PR checks * consolidate changelog * changelog update * Generate dbt docs via GitHub Actions --------- Co-authored-by: fivetran-catfritz <[email protected]> Co-authored-by: Avinash Kunnath <[email protected]> Co-authored-by: Avinash Kunnath <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent d4f0c5f commit 549777a

File tree

60 files changed

+2142
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2142
-191
lines changed

.buildkite/pipeline.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ steps:
33
key: "run-dbt-postgres"
44
plugins:
55
- docker#v3.13.0:
6-
image: "python:3.8"
6+
image: "python:3.10.13"
77
shell: [ "/bin/bash", "-e", "-c" ]
88
environment:
99
- "BASH_ENV=/tmp/.bashrc"
@@ -18,7 +18,7 @@ steps:
1818
key: "run_dbt_snowflake"
1919
plugins:
2020
- docker#v3.13.0:
21-
image: "python:3.8"
21+
image: "python:3.10.13"
2222
shell: [ "/bin/bash", "-e", "-c" ]
2323
environment:
2424
- "BASH_ENV=/tmp/.bashrc"
@@ -35,7 +35,7 @@ steps:
3535
key: "run_dbt_bigquery"
3636
plugins:
3737
- docker#v3.13.0:
38-
image: "python:3.8"
38+
image: "python:3.10.13"
3939
shell: [ "/bin/bash", "-e", "-c" ]
4040
environment:
4141
- "BASH_ENV=/tmp/.bashrc"
@@ -47,7 +47,7 @@ steps:
4747
key: "run_dbt_redshift"
4848
plugins:
4949
- docker#v3.13.0:
50-
image: "python:3.8"
50+
image: "python:3.10.13"
5151
shell: [ "/bin/bash", "-e", "-c" ]
5252
environment:
5353
- "BASH_ENV=/tmp/.bashrc"
@@ -62,7 +62,7 @@ steps:
6262
key: "run_dbt_databricks"
6363
plugins:
6464
- docker#v3.13.0:
65-
image: "python:3.8"
65+
image: "python:3.10.13"
6666
shell: [ "/bin/bash", "-e", "-c" ]
6767
environment:
6868
- "BASH_ENV=/tmp/.bashrc"

.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ Before marking this PR as "ready for review":
1212

1313
## PR Overview
1414
**Package version introduced in this PR:**
15-
15+
-
16+
1617
**This PR addresses the following Issue/Feature(s):**
1718
<!-- Add Issue # or internal ticket reference -->
19+
-
1820

1921
**Summary of changes:**
2022
<!-- 1-2 sentences describing PR changes. -->
21-
23+
-
2224

2325
### Submission Checklist
2426
- [ ] Alignment meeting with the reviewer (if needed)
@@ -27,9 +29,10 @@ Before marking this PR as "ready for review":
2729
- [ ] **Validation Steps:** Check for unintentional effects (e.g., add/run consistency & integrity tests)
2830
- [ ] **Testing Instructions:** Confirm the change addresses the issue(s)
2931
- [ ] **Focus Areas:** Complex logic or queries that need extra attention
32+
- [ ] Merge any relevant open PRs into this PR
3033

3134
### Changelog
3235
<!-- Recommend drafting changelog notes, then refining via ChatGPT using:
3336
"Draft a changelog entry based on the following notes." -->
3437
- [ ] Draft changelog for PR
35-
- [ ] Final changelog for release review
38+
- [ ] Final changelog for release review

.github/workflows/auto-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ on:
33
pull_request:
44
types:
55
- closed
6-
branches:
7-
- main
6+
- labeled
87

98
jobs:
10-
call-workflow-passing-data:
11-
if: github.event.pull_request.merged
9+
release:
10+
if: |
11+
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main') ||
12+
github.event.label.name == 'pre-release'
1213
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
13-
secrets: inherit
14+
secrets: inherit
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'generate dbt docs'
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
7+
jobs:
8+
generate-docs:
9+
if: github.event.label.name == 'docs:ready'
10+
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@main
11+
secrets: inherit
12+
with:
13+
schema_var_name: amazon_ads_schema

.gitignore

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,73 @@
1-
2-
target/
1+
# dbt
2+
**/package-lock.yml
3+
package-lock.yml
4+
.dbt/
35
dbt_modules/
6+
dbt_packages/
47
logs/
8+
profiles.yml
9+
target/
10+
*.log
11+
12+
# IDE files
13+
.idea/
14+
.vscode/
15+
*~
16+
*.swp
17+
*.swo
18+
19+
# Jupyter Notebook
20+
.ipynb_checkpoints
21+
22+
# OS generated files
23+
**/.DS_Store
524
.DS_Store
6-
dbt_packages/
7-
integration_tests/package-lock.yml
8-
integration_tests/.DS_Store
25+
.Spotlight-V100
26+
.Trashes
27+
._*
28+
Thumbs.db
29+
ehthumbs.db
30+
31+
# Python
32+
*.egg
33+
*.egg-info/
34+
*.py[cod]
35+
*.so
36+
*$py.class
37+
.Python
38+
__pycache__/
39+
build/
40+
develop-eggs/
41+
dist/
42+
downloads/
43+
eggs/
44+
.env
45+
.installed.cfg
46+
lib/
47+
lib64/
48+
MANIFEST
49+
parts/
50+
sdist/
51+
var/
52+
wheels/
53+
54+
# Secrets and credentials
55+
.env.*
56+
.secrets
57+
credentials.json
58+
service-account.json
59+
60+
# Temporary files
61+
.cache/
62+
*.temp
63+
*.tmp
64+
65+
# Virtual environments
66+
.conda/
67+
.env
68+
.venv
69+
ENV/
70+
env/
71+
env.bak/
72+
venv/
73+
venv.bak/

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# dbt_amazon_ads v1.0.0
2+
3+
[PR #28](https://github.com/fivetran/dbt_amazon_ads/pull/28) includes the following updates:
4+
5+
## Breaking Changes
6+
7+
### Source Package Consolidation
8+
- Removed the dependency on the `fivetran/amazon_ads_source` package.
9+
- All functionality from the source package has been merged into this transformation package for improved maintainability and clarity.
10+
- If you reference `fivetran/amazon_ads_source` in your `packages.yml`, you must remove this dependency to avoid conflicts.
11+
- Any source overrides referencing the `fivetran/amazon_ads_source` package will also need to be removed or updated to reference this package.
12+
- Update any amazon_ads_source-scoped variables to be scoped to only under this package. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md) for how to configure the build schema of staging models.
13+
- As part of the consolidation, vars are no longer used to reference staging models, and only sources are represented by vars. Staging models are now referenced directly with `ref()` in downstream models.
14+
15+
16+
### dbt Fusion Compatibility Updates
17+
- Updated package to maintain compatibility with dbt-core versions both before and after v1.10.6, which introduced a breaking change to multi-argument test syntax (e.g., `unique_combination_of_columns`).
18+
- Temporarily removed unsupported tests to avoid errors and ensure smoother upgrades across different dbt-core versions. These tests will be reintroduced once a safe migration path is available.
19+
- Removed all `dbt_utils.unique_combination_of_columns` tests.
20+
- Moved `loaded_at_field: _fivetran_synced` under the `config:` block in `src_amazon_ads.yml`.
21+
22+
### Under the Hood
23+
24+
- Updated conditions in `.github/workflows/auto-release.yml`.
25+
- Added `.github/workflows/generate-docs.yml`.
26+
127
# dbt_amazon_ads v0.5.0
228

329
[PR #23](https://github.com/fivetran/dbt_amazon_ads/pull/23) includes the following updates:

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
href="https://github.com/fivetran/dbt_amazon_ads/blob/main/LICENSE">
66
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
77
<a alt="dbt-core">
8-
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_<2.0.0-orange.svg" /></a>
8+
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_,<2.0.0-orange.svg" /></a>
99
<a alt="Maintained?">
1010
<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /></a>
1111
<a alt="PRs">
1212
<img src="https://img.shields.io/badge/Contributions-welcome-blueviolet" /></a>
13+
<a alt="Fivetran Quickstart Compatible"
14+
href="https://fivetran.com/docs/transformations/dbt/quickstart">
15+
<img src="https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg" /></a>
1316
</p>
1417

1518
## What does this dbt package do?
16-
- Produces modeled tables that leverage Amazon Ads data from [Fivetran's connector](https://fivetran.com/docs/applications/amazon-ads) in the format described by [this ERD](https://fivetran.com/docs/applications/amazon-ads#schemainformation) and builds off the output of our [Amazon Ads source package](https://github.com/fivetran/dbt_amazon_ads_source).
19+
- Produces modeled tables that leverage Amazon Ads data from [Fivetran's connector](https://fivetran.com/docs/applications/amazon-ads) in the format described by [this ERD](https://fivetran.com/docs/applications/amazon-ads#schemainformation).
1720
- Provides insight into your ad performance across the following grains:
1821
- Account, portfolio, campaign, ad group, ad, keyword, and search term
1922
- Materializes output models designed to work simultaneously with our [multi-platform Ad Reporting package](https://github.com/fivetran/dbt_ad_reporting).
@@ -58,11 +61,10 @@ Include the following amazon_ads package version in your `packages.yml` file _if
5861
```yaml
5962
packages:
6063
- package: fivetran/amazon_ads
61-
version: [">=0.5.0", "<0.6.0"] # we recommend using ranges to capture non-breaking changes automatically
64+
version: [">=1.0.0", "<1.1.0"] # we recommend using ranges to capture non-breaking changes automatically
6265
```
6366

64-
Do NOT include the `amazon_ads_source` package in this file. The transformation package itself has a dependency on it and will install the source package as well.
65-
67+
> All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/amazon_ads_source` in your `packages.yml` since this package has been deprecated.
6668

6769
### Step 3: Define database and schema variables
6870
By default, this package uses your destination and the `amazon_ads` schema. If your Amazon Ads data is in a different database or schema (for example, if your Amazon Ads schema is named `amazon_ads_fivetran`), add the following configuration to your root `dbt_project.yml` file:
@@ -126,16 +128,16 @@ By default, this package will build the Amazon Ads staging models (11 views, 11
126128

127129
```yml
128130
models:
129-
amazon_ads_source:
130-
+schema: my_new_schema_name # leave blank for just the target_schema
131131
amazon_ads:
132-
+schema: my_new_schema_name # leave blank for just the target_schema
132+
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
133+
staging:
134+
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
133135
```
134136

135137
#### Change the source table references
136138
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. This is not available when running the package on multiple unioned connections.
137139

138-
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_amazon_ads_source/blob/main/dbt_project.yml) variable declarations to see the expected names.
140+
> IMPORTANT: See this project's [`dbt_project.yml`](https://github.com/fivetran/dbt_amazon_ads/blob/main/dbt_project.yml) variable declarations to see the expected names.
139141

140142
```yml
141143
vars:
@@ -154,12 +156,9 @@ Fivetran offers the ability for you to orchestrate your dbt project through [Fiv
154156
## Does this package have dependencies?
155157
This dbt package is dependent on the following dbt packages. Be aware that these dependencies are installed by default within this package. For more information on these packages, refer to the [dbt hub](https://hub.getdbt.com/) site.
156158
> IMPORTANT: If you have any of the dependent packages in your own `packages.yml` file, we highly recommend that you remove them from your root `packages.yml` to avoid package version conflicts.
157-
159+
158160
```yml
159161
packages:
160-
- package: fivetran/amazon_ads_source
161-
version: [">=0.5.0", "<0.6.0"]
162-
163162
- package: fivetran/fivetran_utils
164163
version: [">=0.4.0", "<0.5.0"]
165164

dbt_project.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'amazon_ads'
2-
version: '0.5.0'
2+
version: '1.0.0'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55
models:
@@ -8,16 +8,27 @@ models:
88
+materialized: table
99
intermediate:
1010
+materialized: view
11+
staging:
12+
+schema: amazon_ads_source
13+
+materialized: table
14+
tmp:
15+
+materialized: view
16+
1117
vars:
1218
amazon_ads:
13-
ad_group_history: "{{ ref('stg_amazon_ads__ad_group_history') }}"
14-
ad_group_level_report: "{{ ref('stg_amazon_ads__ad_group_level_report') }}"
15-
advertised_product_report: "{{ ref('stg_amazon_ads__advertised_product_report') }}"
16-
campaign_history: "{{ ref('stg_amazon_ads__campaign_history') }}"
17-
campaign_level_report: "{{ ref('stg_amazon_ads__campaign_level_report') }}"
18-
portfolio_history: "{{ ref('stg_amazon_ads__portfolio_history') }}"
19-
product_ad_history: "{{ ref('stg_amazon_ads__product_ad_history') }}"
20-
profile: "{{ ref('stg_amazon_ads__profile') }}"
21-
keyword_history: "{{ ref('stg_amazon_ads__keyword_history') }}"
22-
targeting_keyword_report: "{{ ref('stg_amazon_ads__targeting_keyword_report') }}"
23-
search_term_ad_keyword_report: "{{ ref('stg_amazon_ads__search_term_ad_keyword_report') }}"
19+
ad_group_history: "{{ source('amazon_ads', 'ad_group_history') }}"
20+
ad_group_level_report: "{{ source('amazon_ads', 'ad_group_level_report') }}"
21+
advertised_product_report: "{{ source('amazon_ads', 'advertised_product_report') }}"
22+
campaign_history: "{{ source('amazon_ads', 'campaign_history') }}"
23+
campaign_level_report: "{{ source('amazon_ads', 'campaign_level_report') }}"
24+
portfolio_history: "{{ source('amazon_ads', 'portfolio_history') }}"
25+
product_ad_history: "{{ source('amazon_ads', 'product_ad_history') }}"
26+
profile: "{{ source('amazon_ads', 'profile') }}"
27+
keyword_history: "{{ source('amazon_ads', 'keyword_history') }}"
28+
targeting_keyword_report: "{{ source('amazon_ads', 'targeting_keyword_report') }}"
29+
search_term_ad_keyword_report: "{{ source('amazon_ads', 'search_term_ad_keyword_report') }}"
30+
amazon_ads__ad_group_passthrough_metrics: []
31+
amazon_ads__advertised_product_passthrough_metrics: []
32+
amazon_ads__campaign_passthrough_metrics: []
33+
amazon_ads__search_term_ad_keyword_passthrough_metrics: []
34+
amazon_ads__targeting_keyword_passthrough_metrics: []

docs/catalog.json

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

0 commit comments

Comments
 (0)