Skip to content

Feature/url tags super#65

Merged
fivetran-catfritz merged 23 commits intomainfrom
feature/url-tags-super
Mar 2, 2026
Merged

Feature/url tags super#65
fivetran-catfritz merged 23 commits intomainfrom
feature/url-tags-super

Conversation

@fivetran-catfritz
Copy link
Copy Markdown
Contributor

@fivetran-catfritz fivetran-catfritz commented Feb 23, 2026

PR Overview

Package version introduced in this PR:

  • v1.4.1

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

Summary of changes:

  • Updates URL tag processing to handle native JSON datatypes across all supported warehouses, preventing errors when url_tags columns are stored as JSON/JSONB/VARIANT/SUPER instead of strings.

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)
    • 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

  • Draft changelog for PR
  • Final changelog for release review

@fivetran-catfritz fivetran-catfritz self-assigned this Feb 23, 2026
Comment on lines -49 to -59
+column_types:
id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
account_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
campaign_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
ad_set_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
ad_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
creative_id: "{{ 'int64' if target.type == 'bigquery' else 'bigint' }}"
page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}"
template_page_link: "{{ 'string' if target.type in ['bigquery','spark','databricks'] else 'varchar' }}"
_fivetran_synced: "timestamp"
updated_time: "timestamp"
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.

Broke these out to individual tables to clean up the buildkite messages.

@fivetran-catfritz fivetran-catfritz linked an issue Feb 24, 2026 that may be closed by this pull request
4 tasks
@fivetran-catfritz fivetran-catfritz marked this pull request as ready for review February 24, 2026 23:49
dbt source freshness --target "$db" || echo "...Only verifying freshness runs…"
dbt run --target "$db" --full-refresh
dbt test --target "$db"
if [ "$db" = "bigquery" ] || [ "$db" = "redshift" ] || [ "$db" = "postgres" ] || [ "$db" = "snowflake" ]; then
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.

this is to test both string and json versions of url_tags.

@fivetran-catfritz fivetran-catfritz added the docs:ready Triggers the docs generator workflow. label Feb 25, 2026
Comment on lines +93 to +97
# Load as VARCHAR first, then convert to native JSON type in a post-hook.
# This is necessary for testing native JSON datatypes with seed data.
+post-hook:
- "alter table {{ this }} add column url_tags {{ 'super' if target.type == 'redshift' else 'variant' if target.type == 'snowflake' else 'json' }} {{ 'default null' if target.type != 'bigquery' }}"
- "update {{ this }} set url_tags = {{ 'json_parse(url_tags_string)' if target.type == 'redshift' else 'url_tags_string::jsonb' if target.type == 'postgres' else 'parse_json(url_tags_string)' }} {{ 'where url_tags_string is not null' if target.type == 'bigquery' }}"
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.

Ah so just for my reference, does dbt not support configuring +column_types as JSONs?

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.

@fivetran-jamie good question! dbt does support it, but when I seeded directly to a JSON type, the seeds consistently ended up with unexpected characters. Also Snowflake just consistently error with the Variant type. This approach was the most reliable way I found to avoid introducing those characters. I also validated the resulting seeded table against the connector data sourced from JSON to make sure the extra characters shouldn't be there.

@fivetran-catfritz fivetran-catfritz linked an issue Feb 27, 2026 that may be closed by this pull request
4 tasks
Corrects the description of the integrity test fix in CHANGELOG.
fivetran-catfritz and others added 4 commits March 2, 2026 12:42
Co-authored-by: Savage Fivetran <sarah.savage@fivetran.com>
* Readme and persist docs update

* persist_docs conditional

---------

Co-authored-by: Joe Markiewicz <74217849+fivetran-joemarkiewicz@users.noreply.github.com>
Updates the integrity test to validate both 'conversions_value' and 'conversions'.
@fivetran-catfritz fivetran-catfritz added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Mar 2, 2026
Copy link
Copy Markdown
Contributor

@fivetran-savage fivetran-savage left a comment

Choose a reason for hiding this comment

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

LGTM!

@fivetran-catfritz fivetran-catfritz added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Mar 2, 2026
@fivetran-catfritz fivetran-catfritz added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Mar 2, 2026
@fivetran-catfritz fivetran-catfritz merged commit bf2e1a7 into main Mar 2, 2026
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.

[Bug] redshift json_array_length(super) error [Feature] explore optimizing get_url_tag_query macro for redshift

4 participants