Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion models/marts/fct_daily_borough_stats.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions tests/assert_avg_tip_pct_within_bounds.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading