Skip to content

Maayan via Elementary: Add data contract tests for cpa_and_roas#896

Open
joostboon wants to merge 1 commit intomasterfrom
elementary-create-dbt-tests-20260325150648183243
Open

Maayan via Elementary: Add data contract tests for cpa_and_roas#896
joostboon wants to merge 1 commit intomasterfrom
elementary-create-dbt-tests-20260325150648183243

Conversation

@joostboon
Copy link
Copy Markdown
Collaborator

Data Contract Enforcement for cpa_and_roas

This PR adds comprehensive data quality tests to enforce a data contract on the cpa_and_roas model:

Tests Added:

  1. Freshness: dbt_utils.recency on day — ensures data includes records from at least yesterday
  2. Completeness: not_null on 5 core columns (day, utm_source, total_spend, attribution_points, attribution_revenue)
  3. Uniqueness: dbt_utils.unique_combination_of_columns on (day, utm_source) — enforces the table grain
  4. Anomaly Detection: elementary.column_anomalies on cost_per_acquisition (average) — monitors CPA for unexpected shifts

Already Covered (not modified):

  • ✅ Freshness anomaly (cloud monitor)
  • ✅ Volume anomaly (cloud monitor)
  • ✅ ROAS anomaly (column_anomalies on return_on_advertising_spend)

    Created by: maayan+172@elementary-data.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant