Skip to content

Commit a2733cc

Browse files
committed
Refactor rate code and trip type models to use validated taxi trips source
1 parent ff066e4 commit a2733cc

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

opendata_stack_platform_dbt/models/gold/dimensions/dim_rate_code.sql

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,7 @@ with rate_code_mapping as (
2222
when rate_code_id = 99 then 'Unknown'
2323
else 'Unknown'
2424
end as rate_code_desc
25-
from (
26-
-- Get all distinct ratecode_id values from Yellow Taxi
27-
select distinct coalesce(cast(ratecode_id as int), 99) as rate_code_id
28-
from {{ source('silver_yellow', 'yellow_taxi_trip') }}
29-
30-
union
31-
32-
-- Get all distinct ratecode_id values from Green Taxi
33-
select distinct coalesce(cast(ratecode_id as int), 99) as rate_code_id
34-
from {{ source('silver_green', 'green_taxi_trip') }}
35-
)
25+
from {{ ref('silver_taxi_trips_validated') }}
3626
),
3727

3828
final as (

opendata_stack_platform_dbt/models/gold/dimensions/dim_trip_type.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ with trip_type_codes as (
2323
-- FHVHV is always dispatch type (2)
2424
-- Yellow Taxi is always street-hail (1)
2525
select distinct trip_type as trip_type_id
26-
from {{ source('silver_green', 'green_taxi_trip') }}
26+
from {{ ref('silver_taxi_trips_validated') }}
2727
where trip_type is not null
2828
)
2929
union all

0 commit comments

Comments
 (0)