Skip to content

Report Facebook media views as impressions in the rollup - #46

Merged
fivetran-jamie merged 16 commits into
magicbot/fy27-updatesfrom
feature/facebook-media-views
Nov 24, 2026
Merged

fivetran-jamie merged 16 commits into
magicbot/fy27-updatesfrom
feature/facebook-media-views

Conversation

@fivetran-jamie

@fivetran-jamie fivetran-jamie commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Overview

Package version introduced in this PR:

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

  • Jira GA-1045042

Summary of changes:

  • Facebook rows in social_media_reporting__rollup_report now report Facebook media views in impressions, because Facebook deprecated impressions metrics on November 15, 2025. Requires Facebook Pages v1.4.0, which now includes the media view changes from Add media view breakdowns from new Facebook Pages tables dbt_facebook_pages#37. The [">=1.4.0", "<1.5.0"] range from FY2027 updates #45 already picks it up.
  • Adds integration test seeds for the three new Facebook Pages tables (lifetime_post_metrics_by_paid_organic, lifetime_post_metrics_by_followers, daily_page_metrics_by_paid_organic), copied from dbt_facebook_pages.
  • Stacked on FY2027 updates #45 and released with it as v1.7.0. Merge this PR into FY2027 updates #45's branch before FY2027 updates #45 merges to main.

Before merge: packages.yml points Facebook Pages at the git branch feature/media-views-breakdowns (fivetran/dbt_facebook_pages#37). Switch it to the hub range [">=1.4.0", "<1.5.0"] once Facebook Pages v1.4.0 is released.

Known limitation (out of scope): Facebook comments and shares stay unpopulated in the rollup.

Submission Checklist

  • Alignment meeting with the reviewer (if needed)
    • Timeline and validation requirements discussed
  • Provide validation details:
    • Validation Steps: DuckDB integration tests pass locally (149 of 149).
    • Testing Instructions: Built on BigQuery against singular-vector-135519.luke_facebook_pages. Facebook rows (most recent record per post): 205 of 364 posts now have impressions above 0, total 9,145. Before this change: 3 posts, total 8.
    • Focus Areas: models/intermediate/social_media_reporting__facebook_posts_reporting.sql
  • Merge any relevant open PRs into this PR (based on FY2027 updates #45)

Changelog

  • Draft changelog for PR (added to .changes/1.7.0.yml)
  • Final changelog for release review

🤖 Generated with Claude Code

fivetran-jamie and others added 4 commits November 20, 2026 16:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fivetran-jamie fivetran-jamie added the docs:ready Triggers the docs generator workflow. label Nov 20, 2026
@fivetran-data-model-bot fivetran-data-model-bot removed the docs:ready Triggers the docs generator workflow. label Nov 20, 2026
…timestamp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fivetran-jamie fivetran-jamie added the docs:ready Triggers the docs generator workflow. label Nov 20, 2026
@fivetran-jamie
fivetran-jamie marked this pull request as ready for review November 23, 2026 15:05
@fivetran-jamie
fivetran-jamie requested a review from a team as a code owner November 23, 2026 15:05
@fivetran-jamie fivetran-jamie added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Nov 23, 2026
Comment thread packages.yml
@@ -1,6 +1,6 @@
packages:
- git: https://github.com/fivetran/dbt_facebook_pages.git
revision: magicbot/fy27-updates

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.

Switch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fivetran-data-model-bot fivetran-data-model-bot removed the docs:ready Triggers the docs generator workflow. label Nov 23, 2026
@fivetran-jamie fivetran-jamie added the docs:ready Triggers the docs generator workflow. label Nov 23, 2026

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

Couple qs.

Do we need to add these to quickstart.yml?

table_variables:
  facebook_pages__using_lifetime_post_metrics_by_paid_organic:
    - lifetime_post_metrics_by_paid_organic
  facebook_pages__using_lifetime_post_metrics_by_followers:
    - lifetime_post_metrics_by_followers
  facebook_pages__using_daily_page_metrics_by_paid_organic:
    - daily_page_metrics_by_paid_organic

Otherwise looks good to me!

'facebook' as platform,
coalesce(sum(clicks),0) as clicks,
coalesce(sum(impressions),0) as impressions, -- Deprecated as of November, 2025. Will be removed in future release.
coalesce(sum(media_views),0) as impressions,

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.

media_views is a float (post_media_view is FLOAT64), so Facebook impressions changes from an integer to a float here. Because union_relations takes the type from the first model it unions, the rollup's impressions becomes a float when Twitter is disabled. Should we cast it, e.g. cast(coalesce(sum(media_views), 0) as {{ dbt.type_bigint() }})?

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fivetran-data-model-bot fivetran-data-model-bot removed the docs:ready Triggers the docs generator workflow. label Nov 24, 2026
fivetran-jamie and others added 2 commits November 24, 2026 11:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
media_views is a float upstream. union_relations takes each column's type
from the first model it unions, so with Twitter disabled the rollup's
impressions became a float for every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fivetran-jamie fivetran-jamie added the docs:ready Triggers the docs generator workflow. label Nov 24, 2026
@fivetran-data-model-bot fivetran-data-model-bot removed the docs:ready Triggers the docs generator workflow. label Nov 24, 2026
@fivetran-jamie fivetran-jamie added the docs:ready Triggers the docs generator workflow. label Nov 24, 2026
Comment thread README.md Resolved
Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
@fivetran-jamie
fivetran-jamie merged commit e11c82d into magicbot/fy27-updates Nov 24, 2026
15 of 16 checks passed
fivetran-catfritz added a commit that referenced this pull request Nov 24, 2026
* fix/update_column_descriptions

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix/update_column_descriptions

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* FY2027 updates

* Add uniqueness tests to staging and end models

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add uniqueness tests to the .changes entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update dbt versions

* Update dbt versions

* Fix the version bump and .changes entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep only customer-facing entries in the .changes file

Moves the column documentation entry out of CHANGELOG.md so the docs:ready pipeline writes the changelog once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Update CHANGELOG

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Standardize the column documentation changelog entry

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Point upstream packages at their FY27 branches

packages.yml uses the upstream magicbot/fy27-updates branches until those releases are published; the future hub ranges are left as comments. The README and .changes list the new ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use data_tests consistently and mark the dbt minimum as breaking

Renames the remaining `tests:` keys to `data_tests:` so the yml no longer mixes the two, and marks the dbt v1.10.0 minimum as a breaking change in the .changes entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Make analytics-solutions the code owner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Report Facebook media views as impressions in the rollup (#46)

* Report Facebook media views as impressions in the rollup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use schema_data_changes format in changelog entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep Facebook Pages on the 1.4.x range

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add seeds for the new Facebook Pages media view tables

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Drop UTC suffix from new Facebook seed timestamps so Postgres infers timestamp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Document Facebook media views as impressions in DECISIONLOG

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Release the Facebook media views change in v1.7.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Add Facebook Pages media view table variables to Quickstart and README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove Facebook Pages media view table section from README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Cast Facebook impressions to bigint so the rollup keeps an integer type

media_views is a float upstream. union_relations takes each column's type
from the first model it unions, so with Twitter disabled the rollup's
impressions became a float for every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Generate dbt docs and update CHANGELOG.md via GitHub Actions

* Update README.md

Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: fivetran-data-model-bot <fivetran-data-model-bot@users.noreply.github.com>
Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>

* Point packages.yml at the published hub releases

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Savage Fivetran <sarah.savage@fivetran.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: fivetran-data-model-bot <fivetran-data-model-bot@users.noreply.github.com>
Co-authored-by: Doug Beatty <doug.beatty@dbtlabs.com>
Co-authored-by: Catherine Fritz <111930712+fivetran-catfritz@users.noreply.github.com>
Co-authored-by: Jamie Rodriguez <65564846+fivetran-jamie@users.noreply.github.com>
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.

3 participants