Skip to content

Union capability - #52

Merged
fivetran-jamie merged 9 commits into
mainfrom
feature-update/union-data
Nov 6, 2025
Merged

Union capability #52
fivetran-jamie merged 9 commits into
mainfrom
feature-update/union-data

Conversation

@fivetran-jamie

@fivetran-jamie fivetran-jamie commented Oct 28, 2025

Copy link
Copy Markdown
Contributor

PR Overview

Package version introduced in this PR:

  • v1.1.0

This PR addresses the following Issue/Feature(s):

  • GA-1007463

Summary of changes:

  • Adds support for running the package on multiple connections at once

Submission Checklist

  • Alignment meeting with the reviewer (if needed)
    • Timeline and validation requirements discussed
  • Provide validation details:
    • Validation Steps: Check for unintentional effects (e.g., add/run consistency & integrity tests)

Consistency tests added for all end models and passing
image

  • Testing Instructions: Confirm the change addresses the issue(s) -- will share in Jira
  • Focus Areas: Complex logic or queries that need extra attention -- has_defined_sources works
image
  • Merge any relevant open PRs into this PR

Changelog

  • Draft changelog for PR
  • Final changelog for release review

@fivetran-jamie fivetran-jamie self-assigned this Oct 28, 2025
@fivetran-jamie
fivetran-jamie marked this pull request as ready for review October 28, 2025 17:00

@fivetran-catfritz fivetran-catfritz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking in order! Left some suggestions and comments.

) }}

{% set columns_to_exclude = ['activity_id'] %}
{% set columns_to_exclude = ['activity_id', 'source_relation', 'email_template_id', 'email_send_id'] %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest something like the below, where source_relation would be passed to a var like consistency_test_exclude_columns. After this release, we would want to include source_relation in the test. This would apply to all the consistency tests.

Suggested change
{% set columns_to_exclude = ['activity_id', 'source_relation', 'email_template_id', 'email_send_id'] %}
{% set columns_to_exclude = ['activity_id', 'email_template_id', 'email_send_id'] + var('consistency_test_exclude_columns', [] %}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment thread models/staging/stg_marketo.yml
Comment thread models/staging/stg_marketo__lead.sql
{% if execute %}
{% set first_date_query %}
select min( created_at ) as min_date from {{ source('marketo','lead') }}
select min( created_timestamp ) as min_date from {{ ref('stg_marketo__lead') }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From our discussion, suggest to use _tmp so it's more 1:1

Suggested change
select min( created_timestamp ) as min_date from {{ ref('stg_marketo__lead') }}
select min(created_at) as min_date from {{ ref('stg_marketo__lead_tmp') }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@fivetran-jamie fivetran-jamie added the docs:ready Triggers the docs generator workflow. label Nov 4, 2025
) }}

{% set columns_to_exclude = ['activity_id'] %}
{% set columns_to_exclude = var('consistency_test_exclude_columns', []) %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think activity_id would always be excluded?

Suggested change
{% set columns_to_exclude = var('consistency_test_exclude_columns', []) %}
{% set columns_to_exclude = ['activity_id'] + var('consistency_test_exclude_columns', []) %}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating directly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm the order of operations is still off I think. Line 12 would overwrite the work of line 9? I tink you just need to replace line 6 with line 12, and remove line 12.

@fivetran-jamie fivetran-jamie Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh yeah, updating!

enabled=var('fivetran_validation_tests_enabled', false) and var('marketo__enable_campaigns', true) and var('marketo__enable_programs', true)
) }}

{% set exclude_cols = ['source_relation'] %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this anymore.

Suggested change
{% set exclude_cols = ['source_relation'] %}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing directly

Comment thread models/intermediate/marketo__change_data_scd.sql Outdated
Comment thread CHANGELOG.md
) }}

{% set columns_to_exclude = ['activity_id'] %}
{% set columns_to_exclude = var('consistency_test_exclude_columns', []) %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm the order of operations is still off I think. Line 12 would overwrite the work of line 9? I tink you just need to replace line 6 with line 12, and remove line 12.

else 1 end) over (
partition by unioned.lead_id
order by coalesce(unioned.date_day, current_date) desc
partition by unioned.lead_id {{ partition_by_source_relation(alias='unioned') }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do find and replace to add this wherever it's used.

Suggested change
partition by unioned.lead_id {{ partition_by_source_relation(alias='unioned') }}
partition by unioned.lead_id {{ marketo.partition_by_source_relation(alias='unioned') }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I already did -- I think this is outdated

@fivetran-catfritz fivetran-catfritz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@fivetran-jamie fivetran-jamie added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Nov 6, 2025
@fivetran-jamie
fivetran-jamie merged commit baf1170 into main Nov 6, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs:ready Triggers the docs generator workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants