Skip to content
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
10 changes: 5 additions & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ steps:
key: "run-dbt-postgres"
plugins:
- docker#v3.13.0:
image: "python:3.8"
image: "python:3.10.13"
shell: [ "/bin/bash", "-e", "-c" ]
environment:
- "BASH_ENV=/tmp/.bashrc"
Expand All @@ -18,7 +18,7 @@ steps:
key: "run_dbt_snowflake"
plugins:
- docker#v3.13.0:
image: "python:3.8"
image: "python:3.10.13"
shell: [ "/bin/bash", "-e", "-c" ]
environment:
- "BASH_ENV=/tmp/.bashrc"
Expand All @@ -35,7 +35,7 @@ steps:
key: "run_dbt_bigquery"
plugins:
- docker#v3.13.0:
image: "python:3.8"
image: "python:3.10.13"
shell: [ "/bin/bash", "-e", "-c" ]
environment:
- "BASH_ENV=/tmp/.bashrc"
Expand All @@ -47,7 +47,7 @@ steps:
key: "run_dbt_redshift"
plugins:
- docker#v3.13.0:
image: "python:3.8"
image: "python:3.10.13"
shell: [ "/bin/bash", "-e", "-c" ]
environment:
- "BASH_ENV=/tmp/.bashrc"
Expand All @@ -62,7 +62,7 @@ steps:
key: "run_dbt_databricks"
plugins:
- docker#v3.13.0:
image: "python:3.8"
image: "python:3.10.13"
shell: [ "/bin/bash", "-e", "-c" ]
environment:
- "BASH_ENV=/tmp/.bashrc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ Before marking this PR as "ready for review":

## PR Overview
**Package version introduced in this PR:**

-

**This PR addresses the following Issue/Feature(s):**
<!-- Add Issue # or internal ticket reference -->
-

**Summary of changes:**
<!-- 1-2 sentences describing PR changes. -->

-

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

### Changelog
<!-- Recommend drafting changelog notes, then refining via ChatGPT using:
"Draft a changelog entry based on the following notes." -->
- [ ] Draft changelog for PR
- [ ] Final changelog for release review
- [ ] Final changelog for release review
11 changes: 6 additions & 5 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ on:
pull_request:
types:
- closed
branches:
- main
- labeled

jobs:
call-workflow-passing-data:
if: github.event.pull_request.merged
release:
if: |
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main') ||
github.event.label.name == 'pre-release'
uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
secrets: inherit
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'generate dbt docs'
on:
pull_request:
types:
- labeled

jobs:
generate-docs:
if: github.event.label.name == 'docs:ready'
uses: fivetran/dbt_package_automations/.github/workflows/generate-docs.yml@main
secrets: inherit
with:
schema_var_name: amazon_ads_schema
75 changes: 70 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,73 @@

target/
# dbt
**/package-lock.yml
package-lock.yml
.dbt/
dbt_modules/
dbt_packages/
logs/
profiles.yml
target/
*.log

# IDE files
.idea/
.vscode/
*~
*.swp
*.swo

# Jupyter Notebook
.ipynb_checkpoints

# OS generated files
**/.DS_Store
.DS_Store
dbt_packages/
integration_tests/package-lock.yml
integration_tests/.DS_Store
.Spotlight-V100
.Trashes
._*
Thumbs.db
ehthumbs.db

# Python
*.egg
*.egg-info/
*.py[cod]
*.so
*$py.class
.Python
__pycache__/
build/
develop-eggs/
dist/
downloads/
eggs/
.env
.installed.cfg
lib/
lib64/
MANIFEST
parts/
sdist/
var/
wheels/

# Secrets and credentials
.env.*
.secrets
credentials.json
service-account.json

# Temporary files
.cache/
*.temp
*.tmp

# Virtual environments
.conda/
.env
.venv
ENV/
env/
env.bak/
venv/
venv.bak/
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# dbt_amazon_ads v1.0.0

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

## Breaking Changes

### Source Package Consolidation
- Removed the dependency on the `fivetran/amazon_ads_source` package.
- All functionality from the source package has been merged into this transformation package for improved maintainability and clarity.
- If you reference `fivetran/amazon_ads_source` in your `packages.yml`, you must remove this dependency to avoid conflicts.
- Any source overrides referencing the `fivetran/amazon_ads_source` package will also need to be removed or updated to reference this package.
- 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.
- 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.


### dbt Fusion Compatibility Updates
- 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`).
- 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.
- Removed all `dbt_utils.unique_combination_of_columns` tests.
- Moved `loaded_at_field: _fivetran_synced` under the `config:` block in `src_amazon_ads.yml`.

### Under the Hood

- Updated conditions in `.github/workflows/auto-release.yml`.
- Added `.github/workflows/generate-docs.yml`.

# dbt_amazon_ads v0.5.0

[PR #23](https://github.com/fivetran/dbt_amazon_ads/pull/23) includes the following updates:
Expand Down
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
href="https://github.com/fivetran/dbt_amazon_ads/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" /></a>
<a alt="dbt-core">
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_<2.0.0-orange.svg" /></a>
<img src="https://img.shields.io/badge/dbt_Core™_version->=1.3.0_,<2.0.0-orange.svg" /></a>
<a alt="Maintained?">
<img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" /></a>
<a alt="PRs">
<img src="https://img.shields.io/badge/Contributions-welcome-blueviolet" /></a>
<a alt="Fivetran Quickstart Compatible"
href="https://fivetran.com/docs/transformations/dbt/quickstart">
<img src="https://img.shields.io/badge/Fivetran_Quickstart_Compatible%3F-yes-green.svg" /></a>
</p>

## What does this dbt package do?
- 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).
- 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).
- Provides insight into your ad performance across the following grains:
- Account, portfolio, campaign, ad group, ad, keyword, and search term
- Materializes output models designed to work simultaneously with our [multi-platform Ad Reporting package](https://github.com/fivetran/dbt_ad_reporting).
Expand Down Expand Up @@ -58,11 +61,10 @@ Include the following amazon_ads package version in your `packages.yml` file _if
```yaml
packages:
- package: fivetran/amazon_ads
version: [">=0.5.0", "<0.6.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=1.0.0", "<1.1.0"] # we recommend using ranges to capture non-breaking changes automatically
```

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.

> 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.

### Step 3: Define database and schema variables
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:
Expand Down Expand Up @@ -126,16 +128,16 @@ By default, this package will build the Amazon Ads staging models (11 views, 11

```yml
models:
amazon_ads_source:
+schema: my_new_schema_name # leave blank for just the target_schema
amazon_ads:
+schema: my_new_schema_name # leave blank for just the target_schema
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
staging:
+schema: my_new_schema_name # Leave +schema: blank to use the default target_schema.
```

#### Change the source table references
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.

> 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.
> 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.

```yml
vars:
Expand All @@ -154,12 +156,9 @@ Fivetran offers the ability for you to orchestrate your dbt project through [Fiv
## Does this package have dependencies?
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.
> 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.

```yml
packages:
- package: fivetran/amazon_ads_source
version: [">=0.5.0", "<0.6.0"]

- package: fivetran/fivetran_utils
version: [">=0.4.0", "<0.5.0"]

Expand Down
35 changes: 23 additions & 12 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'amazon_ads'
version: '0.5.0'
version: '1.0.0'
config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
models:
Expand All @@ -8,16 +8,27 @@ models:
+materialized: table
intermediate:
+materialized: view
staging:
+schema: amazon_ads_source
+materialized: table
tmp:
+materialized: view

vars:
amazon_ads:
ad_group_history: "{{ ref('stg_amazon_ads__ad_group_history') }}"
ad_group_level_report: "{{ ref('stg_amazon_ads__ad_group_level_report') }}"
advertised_product_report: "{{ ref('stg_amazon_ads__advertised_product_report') }}"
campaign_history: "{{ ref('stg_amazon_ads__campaign_history') }}"
campaign_level_report: "{{ ref('stg_amazon_ads__campaign_level_report') }}"
portfolio_history: "{{ ref('stg_amazon_ads__portfolio_history') }}"
product_ad_history: "{{ ref('stg_amazon_ads__product_ad_history') }}"
profile: "{{ ref('stg_amazon_ads__profile') }}"
keyword_history: "{{ ref('stg_amazon_ads__keyword_history') }}"
targeting_keyword_report: "{{ ref('stg_amazon_ads__targeting_keyword_report') }}"
search_term_ad_keyword_report: "{{ ref('stg_amazon_ads__search_term_ad_keyword_report') }}"
ad_group_history: "{{ source('amazon_ads', 'ad_group_history') }}"
ad_group_level_report: "{{ source('amazon_ads', 'ad_group_level_report') }}"
advertised_product_report: "{{ source('amazon_ads', 'advertised_product_report') }}"
campaign_history: "{{ source('amazon_ads', 'campaign_history') }}"
campaign_level_report: "{{ source('amazon_ads', 'campaign_level_report') }}"
portfolio_history: "{{ source('amazon_ads', 'portfolio_history') }}"
product_ad_history: "{{ source('amazon_ads', 'product_ad_history') }}"
profile: "{{ source('amazon_ads', 'profile') }}"
keyword_history: "{{ source('amazon_ads', 'keyword_history') }}"
targeting_keyword_report: "{{ source('amazon_ads', 'targeting_keyword_report') }}"
search_term_ad_keyword_report: "{{ source('amazon_ads', 'search_term_ad_keyword_report') }}"
amazon_ads__ad_group_passthrough_metrics: []
amazon_ads__advertised_product_passthrough_metrics: []
amazon_ads__campaign_passthrough_metrics: []
amazon_ads__search_term_ad_keyword_passthrough_metrics: []
amazon_ads__targeting_keyword_passthrough_metrics: []
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

Loading