Skip to content

JustinSmethers/feb-26-ai-hackathon

Repository files navigation

NYC Taxi dbt (BigQuery)

This repository contains a dbt-core + dbt-bigquery project that models January 2025 NYC taxi data into a unified fact_trips model.

Inputs (January 2025)

  • feb-488118.prod_taxi_raw.yellow_tripdata_2025_01
  • feb-488118.prod_taxi_raw.green_tripdata_2025_01
  • feb-488118.prod_taxi_raw.fhv_tripdata_2025_01
  • feb-488118.prod_taxi_raw.fhvhv_tripdata_2025_01
  • feb-488118.prod_taxi_raw.taxi_zone_lookup

Project layout

  • models/src/: raw source models (src_*)
  • models/staging/: canonicalized staging models (stg_*)
  • models/marts/: conformed dimension (dim_zone) + unified fact table (fact_trips)
  • models/marts/marts.yml: fact-level tests
  • tests/fact_trips_non_negative_duration.sql: custom data test

Setup

uv sync
uv run dbt debug --profiles-dir .

Build (fast dev path)

uv run dbt run --profiles-dir . --select src_yellow_trips src_green_trips src_fhv_trips src_fhvhv_trips dim_zone stg_yellow_trips stg_green_trips stg_fhv_trips stg_fhvhv_trips

Validate model SQL with sample output

uv run dbt show --profiles-dir . --select stg_yellow_trips --indirect-selection empty --limit 5
uv run dbt show --profiles-dir . --select stg_green_trips --indirect-selection empty --limit 5
uv run dbt show --profiles-dir . --select stg_fhv_trips --indirect-selection empty --limit 5
uv run dbt show --profiles-dir . --select stg_fhvhv_trips --indirect-selection empty --limit 5
uv run dbt show --profiles-dir . --select fact_trips --indirect-selection empty --limit 5

Full fact build and tests

fact_trips is configured as a table and processes all January 2025 rows across all sources.

uv run dbt run --profiles-dir . --select fact_trips --indirect-selection empty
uv run dbt test --profiles-dir . --select fact_trips+

Notes

  • For a new month, update table vars in dbt_project.yml (*_tripdata_table) and service_month, then rerun.
  • Ensure the target dataset location matches your profile location (for example US).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors