From c4b86e80a066beb46cb26128bd54b8c5572372b7 Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Thu, 4 Jun 2026 13:03:28 -0700 Subject: [PATCH 01/10] Documentation --- CHANGELOG.md | 20 ++++++++++++++++++-- README.md | 10 +++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f02138..dc66095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ # dbt_amazon_ads v1.3.0 -TBD +[PR #47](https://github.com/fivetran/dbt_amazon_ads/pull/47) includes the following updates: + +## Schema/Data Change +**1 total change • 1 possible breaking change** + +| Data Model(s) | Change type | Old | New | Notes | +| ------------- | ----------- | --- | --- | ----- | +| All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Powered by the new `fivetran_utils.apply_source_relation` macro | + +## Feature Update +- Introduces the `amazon_ads_sources` variable, which lets you union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. + - The old `amazon_ads_union_schemas` and `amazon_ads_union_databases` variables remain supported for backward compatibility. + + +## Under the Hood +- Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_amazon_ads/#source-casing-for-case-sensitive-destinations) section of the README for details. +- Introduces `fivetran_utils.partition_by_source_relation` for partitioning by source model across staging models. # dbt_amazon_ads v1.2.0 @@ -33,7 +49,7 @@ TBD - 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. +- As part of theconfigurations 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 diff --git a/README.md b/README.md index 3907c0a..fa2643f 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Include the following amazon_ads package version in your `packages.yml` file _if ```yaml packages: - package: fivetran/amazon_ads - version: [">=1.2.0", "<1.3.0"] # we recommend using ranges to capture non-breaking changes automatically + version: [">=1.3.0", "<1.4.0"] # we recommend using ranges to capture non-breaking changes automatically ``` > 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. @@ -180,6 +180,14 @@ vars: amazon_ads__identifier: your_table_name ``` +#### Source casing for case-sensitive destinations +By default, the package applies case-insensitive comparisons when resolving `source_relation` values. If your destination is case-sensitive and you want downstream transformations to respect the exact casing of your source database and schema names, set the following variable: + +```yml +vars: + fivetran_using_source_casing: true +``` + ### (Optional) Orchestrate your models with Fivetran Transformations for dbt Core™ From 9ee2e54e8e5ccc6faeb388befdc23aabc12f9634 Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Thu, 4 Jun 2026 13:46:18 -0700 Subject: [PATCH 02/10] CHANGELOG --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc66095..54f612e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,9 @@ - Introduces the `amazon_ads_sources` variable, which lets you union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. - The old `amazon_ads_union_schemas` and `amazon_ads_union_databases` variables remain supported for backward compatibility. - ## Under the Hood - Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_amazon_ads/#source-casing-for-case-sensitive-destinations) section of the README for details. -- Introduces `fivetran_utils.partition_by_source_relation` for partitioning by source model across staging models. +- Introduces `fivetran_utils.partition_by_source_relation` to conditionally include `source_relation` in partition clauses only when multiple sources are configured. # dbt_amazon_ads v1.2.0 From 17ed1ab50b27c634e3854949536c15413341c153 Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Thu, 4 Jun 2026 13:53:15 -0700 Subject: [PATCH 03/10] CHANGELOG --- CHANGELOG.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f612e..61ffcde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,15 +3,12 @@ [PR #47](https://github.com/fivetran/dbt_amazon_ads/pull/47) includes the following updates: ## Schema/Data Change -**1 total change • 1 possible breaking change** +**2 total changes • 1 possible breaking change** | Data Model(s) | Change type | Old | New | Notes | | ------------- | ----------- | --- | --- | ----- | -| All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Powered by the new `fivetran_utils.apply_source_relation` macro | - -## Feature Update -- Introduces the `amazon_ads_sources` variable, which lets you union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. - - The old `amazon_ads_union_schemas` and `amazon_ads_union_databases` variables remain supported for backward compatibility. +| All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Powered by the new `fivetran_utils.apply_source_relation` macro. | +| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `..` | Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. The legacy `amazon_ads_union_schemas` and `amazon_ads_union_databases` variables remain supported. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | ## Under the Hood - Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_amazon_ads/#source-casing-for-case-sensitive-destinations) section of the README for details. From d070149111832364475a7354f3931110de23d3b9 Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Thu, 4 Jun 2026 14:03:13 -0700 Subject: [PATCH 04/10] syntax --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ffcde..b14e615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,7 @@ - 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 theconfigurations 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. +- 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 From 258e8fa35346edfe08b9391c67a27bafe6f7ed1e Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Thu, 4 Jun 2026 14:43:52 -0700 Subject: [PATCH 05/10] CHANGELOG --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b14e615..777223d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,14 @@ [PR #47](https://github.com/fivetran/dbt_amazon_ads/pull/47) includes the following updates: -## Schema/Data Change -**2 total changes • 1 possible breaking change** +## Schema/Data Changes +**3 total changes • 2 possible breaking changes** | Data Model(s) | Change type | Old | New | Notes | | ------------- | ----------- | --- | --- | ----- | | All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Powered by the new `fivetran_utils.apply_source_relation` macro. | -| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `..` | Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. The legacy `amazon_ads_union_schemas` and `amazon_ads_union_databases` variables remain supported. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | +| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `..` | Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | +| All models | `source_relation` value for legacy `amazon_ads_union_schemas` / `amazon_ads_union_databases` users | Schema or database name (e.g. `my_schema`) | Empty string (`''`) | `fivetran_utils.apply_source_relation` calls `source_relation()` without package-specific variable arguments, so the legacy union variables no longer populate `source_relation`. We recommend migrating to `amazon_ads_sources` for meaningful `source_relation` values. | ## Under the Hood - Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_amazon_ads/#source-casing-for-case-sensitive-destinations) section of the README for details. From 86b8560e4187c4a7c3f4daa39ce17a403e991259 Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Fri, 5 Jun 2026 14:00:21 -0400 Subject: [PATCH 06/10] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 777223d..effcde7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ | Data Model(s) | Change type | Old | New | Notes | | ------------- | ----------- | --- | --- | ----- | | All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Powered by the new `fivetran_utils.apply_source_relation` macro. | -| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `..` | Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | +| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `.` | Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | | All models | `source_relation` value for legacy `amazon_ads_union_schemas` / `amazon_ads_union_databases` users | Schema or database name (e.g. `my_schema`) | Empty string (`''`) | `fivetran_utils.apply_source_relation` calls `source_relation()` without package-specific variable arguments, so the legacy union variables no longer populate `source_relation`. We recommend migrating to `amazon_ads_sources` for meaningful `source_relation` values. | ## Under the Hood From 380ea4fb4bc75217814da6b77b769707274d3f9b Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Fri, 5 Jun 2026 17:08:41 -0400 Subject: [PATCH 07/10] Changelog fixes --- CHANGELOG.md | 7 +++---- integration_tests/dbt_project.yml | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index effcde7..bcbc37b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,12 @@ [PR #47](https://github.com/fivetran/dbt_amazon_ads/pull/47) includes the following updates: ## Schema/Data Changes -**3 total changes • 2 possible breaking changes** +**2 total changes • 1 possible breaking change** | Data Model(s) | Change type | Old | New | Notes | | ------------- | ----------- | --- | --- | ----- | -| All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Powered by the new `fivetran_utils.apply_source_relation` macro. | -| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `.` | Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | -| All models | `source_relation` value for legacy `amazon_ads_union_schemas` / `amazon_ads_union_databases` users | Schema or database name (e.g. `my_schema`) | Empty string (`''`) | `fivetran_utils.apply_source_relation` calls `source_relation()` without package-specific variable arguments, so the legacy union variables no longer populate `source_relation`. We recommend migrating to `amazon_ads_sources` for meaningful `source_relation` values. | +| All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Values are derived from the `amazon_ads_database` and `amazon_ads_schema` variables (or their defaults). Powered by the new `fivetran_utils.apply_source_relation` macro. | +| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `.` | Values are derived from each entry's `database` and `schema` fields in `amazon_ads_sources`. Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | ## Under the Hood - Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_amazon_ads/#source-casing-for-case-sensitive-destinations) section of the README for details. diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 568b566..e890e06 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'amazon_ads_integration_tests' -version: '1.3.0' +version: '1.2.0' profile: 'integration_tests' @@ -39,7 +39,7 @@ dispatch: seeds: +docs: show: False - +quote_columns: "{{ target.type == 'redshift' or not var('using_deliberate_quoting', true) }}" + +quote_columns: "{{ true if target.type == 'redshift' else false }}" amazon_ads_integration_tests: ad_group_level_report_data: +column_types: From 7d36d1837473d6981f3c60175a261c79e785645d Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Fri, 5 Jun 2026 17:09:43 -0400 Subject: [PATCH 08/10] version --- integration_tests/dbt_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index e890e06..2b60cf1 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,7 +1,7 @@ config-version: 2 name: 'amazon_ads_integration_tests' -version: '1.2.0' +version: '1.3.0' profile: 'integration_tests' From 792e4fef76948097ce8d9c7e0d8921ac34aef0ce Mon Sep 17 00:00:00 2001 From: Avinash Kunnath Date: Fri, 5 Jun 2026 17:10:48 -0400 Subject: [PATCH 09/10] Quote columns --- integration_tests/dbt_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 2b60cf1..568b566 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -39,7 +39,7 @@ dispatch: seeds: +docs: show: False - +quote_columns: "{{ true if target.type == 'redshift' else false }}" + +quote_columns: "{{ target.type == 'redshift' or not var('using_deliberate_quoting', true) }}" amazon_ads_integration_tests: ad_group_level_report_data: +column_types: From c5db8e5e627c307afc482b181a807a0b345ba3d3 Mon Sep 17 00:00:00 2001 From: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> Date: Mon, 8 Jun 2026 10:17:41 -0500 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com> --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcbc37b..91ba708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,15 @@ [PR #47](https://github.com/fivetran/dbt_amazon_ads/pull/47) includes the following updates: -## Schema/Data Changes +## Schema/Data Changes (--full-refresh required after upgrading) **2 total changes • 1 possible breaking change** | Data Model(s) | Change type | Old | New | Notes | | ------------- | ----------- | --- | --- | ----- | -| All models | Single-connection `source_relation` value | Empty string (`''`) | `.` | Values are derived from the `amazon_ads_database` and `amazon_ads_schema` variables (or their defaults). Powered by the new `fivetran_utils.apply_source_relation` macro. | -| All models | `source_relation` value for `amazon_ads_sources` users | Empty string (`''`) | `.` | Values are derived from each entry's `database` and `schema` fields in `amazon_ads_sources`. Introduces the `amazon_ads_sources` variable to union multiple Amazon Ads connections simultaneously. See the [README](https://github.com/fivetran/dbt_amazon_ads/blob/main/README.md#option-b-union-multiple-connections) for setup details. | +| All models | `source_relation` column (when using a single Amazon Ads schema) | Empty string (`''`) | `.` | | + +## Feature Updates +- Introduces the new (recommended) `amazon_ads_sources` variable for more robust union data configuration. The old `amazon_ads_union_schemas` and `amazon_ads_union_databases` variables will still be supported. See the [README](https://github.com/fivetran/dbt_amazon_ads/tree/main#define-database-and-schema-variables) for specific details. ## Under the Hood - Adds the `fivetran_using_source_casing` variable for case-sensitive destination support. When enabled, downstream transformations respect source casing to ensure consistent results. See the [Additional Configurations](https://github.com/fivetran/dbt_amazon_ads/#source-casing-for-case-sensitive-destinations) section of the README for details.