diff --git a/models/marts/fct_daily_borough_stats.sql b/models/marts/fct_daily_borough_stats.sql index b7ad20e..bf47070 100644 --- a/models/marts/fct_daily_borough_stats.sql +++ b/models/marts/fct_daily_borough_stats.sql @@ -14,7 +14,10 @@ zones AS ( ) SELECT - -- TODO: join trips to zones on pickup_location_id = location_id + -- TODO: join trips to zones on pickup_location_id = location_id. + -- Use an INNER JOIN: a few trips have a pickup_location_id with no matching + -- zone (e.g. 999). INNER JOIN drops those so pickup_borough is never NULL and + -- can serve as part of the mart's primary key (your not_null test needs this). -- TODO: aggregate to grain (pickup_borough, pickup_date) -- Required output columns: -- pickup_borough TEXT - z.borough diff --git a/tests/assert_avg_tip_pct_within_bounds.sql b/tests/assert_avg_tip_pct_within_bounds.sql index e9141b6..b0fab32 100644 --- a/tests/assert_avg_tip_pct_within_bounds.sql +++ b/tests/assert_avg_tip_pct_within_bounds.sql @@ -3,11 +3,15 @@ -- which is unusual and almost always indicates a small-sample bucket (e.g. the -- Unknown borough) where a few high-tip outliers dominate the average. -- --- This test is intentionally set to WARN severity in dbt_project.yml so it --- does not block the build, but it surfaces the anomaly for the reports/answers.md --- write-up. The assignment rubric requires documenting this finding. +-- Set this test to WARN severity by adding an inline config at the top of this +-- file (below these comments): {{ config(severity='warn') }} +-- That keeps a few expected Unknown-borough rows from blocking `dbt build`, while +-- still surfacing them for your reports/answers.md write-up (the rubric requires +-- documenting this finding). Do NOT set a project-level test severity in +-- dbt_project.yml: that would also downgrade your not_null and +-- unique_combination primary-key tests, which you want to stay at ERROR. -- --- The test passes when zero rows are returned; any returned rows are flagged. +-- The test passes (no WARN) when zero rows are returned; any returned rows are flagged. -- TODO: write the SELECT here. -- Query {{ ref('fct_daily_borough_stats') }} and return rows where avg_tip_pct > 1.