-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Reorder NTD external tables list Alphabetically - Add Documentation and Tests for - Remove deprecated dim_annual_ntd_agency_service [#3396]
- Loading branch information
Showing
7 changed files
with
1,963 additions
and
380 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
warehouse/models/mart/ntd/dim_annual_ntd_agency_service.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{ config(materialized="table") }} | ||
|
||
WITH source AS ( | ||
SELECT * FROM {{ ref("stg_ntd_annual_data__2022__service_by_agency") }} | ||
) | ||
|
||
SELECT {{ dbt_utils.generate_surrogate_key(['report_year', '_5_digit_ntd_id']) }} as key, | ||
report_year, | ||
_5_digit_ntd_id AS ntd_id, | ||
agency, | ||
max_reporter_type, | ||
max_organization_type, | ||
max_city, | ||
max_state, | ||
max_agency_voms, | ||
max_primary_uza_code, | ||
max_primary_uza_name, | ||
max_primary_uza_area_sq_miles, | ||
max_primary_uza_population, | ||
max_service_area_sq_miles, | ||
max_service_area_population, | ||
sum_actual_vehicles_passenger_car_deadhead_hours, | ||
sum_actual_vehicles_passenger_car_hours, | ||
sum_actual_vehicles_passenger_car_miles, | ||
sum_actual_vehicles_passenger_car_revenue_hours, | ||
sum_actual_vehicles_passenger_car_revenue_miles, | ||
sum_actual_vehicles_passenger_deadhead_miles, | ||
sum_scheduled_vehicles_passenger_car_revenue_miles, | ||
sum_charter_service_hours, | ||
sum_school_bus_hours, | ||
sum_trains_in_operation, | ||
sum_directional_route_miles, | ||
sum_passenger_miles, | ||
sum_train_miles, | ||
sum_train_revenue_miles, | ||
sum_train_deadhead_miles, | ||
sum_train_hours, | ||
sum_train_revenue_hours, | ||
sum_train_deadhead_hours, | ||
sum_ada_upt, | ||
sum_sponsored_service_upt, | ||
sum_unlinked_passenger_trips_upt | ||
FROM source |
78 changes: 78 additions & 0 deletions
78
warehouse/models/mart/ntd/dim_annual_service_mode_time_periods.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{{ config(materialized="table") }} | ||
|
||
WITH source AS ( | ||
SELECT * FROM {{ ref("stg_ntd_annual_data__2022__service_by_mode_and_time_period") }} | ||
) | ||
|
||
SELECT {{ dbt_utils.generate_surrogate_key(['report_year', '_5_digit_ntd_id', 'type_of_service', 'mode', 'time_period']) }} as key, | ||
report_year, | ||
type_of_service, | ||
_5_digit_ntd_id AS ntd_id, | ||
agency, | ||
mode, | ||
mode_name, | ||
time_period, | ||
time_service_begins, | ||
time_service_ends, | ||
reporter_type, | ||
city, | ||
state, | ||
actual_vehicles_passenger_car_deadhead_hours, | ||
actual_vehicles_passenger_car_hours, | ||
actual_vehicles_passenger_car_miles, | ||
actual_vehicles_passenger_car_revenue_hours, | ||
actual_vehicles_passenger_car_revenue_miles, | ||
actual_vehicles_passenger_deadhead_miles, | ||
ada_upt, | ||
agency_voms, | ||
aptl_questionable, | ||
average_passenger_trip_length_aptl_, | ||
average_speed, | ||
average_speed_questionable, | ||
brt_non_statutory_mixed_traffic, | ||
charter_service_hours, | ||
days_of_service_operated, | ||
days_not_operated_strikes, | ||
days_not_operated_emergencies, | ||
deadhead_hours_questionable, | ||
deadhead_miles_questionable, | ||
directional_route_miles, | ||
directional_route_miles_questionable, | ||
mixed_traffic_right_of_way, | ||
mode_voms, | ||
mode_voms_questionable, | ||
organization_type, | ||
passenger_miles, | ||
passenger_miles_questionable, | ||
passengers_per_hour, | ||
passengers_per_hour_questionable, | ||
primary_uza_area_sq_miles, | ||
primary_uza_code, | ||
primary_uza_name, | ||
primary_uza_population, | ||
scheduled_revenue_miles_questionable, | ||
scheduled_vehicles_passenger_car_revenue_miles, | ||
school_bus_hours, | ||
service_area_population, | ||
service_area_sq_miles, | ||
sponsored_service_upt, | ||
train_deadhead_hours, | ||
train_deadhead_miles, | ||
train_hours, | ||
train_hours_questionable, | ||
trains_in_operation, | ||
trains_in_operation_questionable, | ||
train_miles, | ||
train_miles_questionable, | ||
train_revenue_hours, | ||
train_revenue_hours_questionable, | ||
train_revenue_miles, | ||
train_revenue_miles_questionable, | ||
unlinked_passenger_trips_upt, | ||
unlinked_passenger_trips_questionable, | ||
vehicle_hours_questionable, | ||
vehicle_miles_questionable, | ||
vehicle_revenue_hours_questionable, | ||
vehicle_revenue_miles_questionable | ||
FROM source | ||
WHERE source.time_period != "Annual Total" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{{ config(materialized="table") }} | ||
|
||
WITH source AS ( | ||
SELECT * FROM {{ ref("stg_ntd_annual_data__2022__service_by_mode") }} | ||
) | ||
|
||
SELECT {{ dbt_utils.generate_surrogate_key(['report_year', '_5_digit_ntd_id', 'type_of_service', 'mode']) }} as key, | ||
report_year, | ||
_5_digit_ntd_id AS ntd_id, | ||
type_of_service, | ||
mode, | ||
max_mode_name AS mode_name, | ||
questionable_record, | ||
max_agency, | ||
max_agency_voms, | ||
max_city, | ||
max_state, | ||
max_mode_voms, | ||
max_reporter_type, | ||
max_organization_type, | ||
max_time_period, | ||
min_time_service_begins, | ||
max_time_service_ends, | ||
max_primary_uza_code, | ||
max_primary_uza_name, | ||
max_primary_uza_area_sq_miles, | ||
max_primary_uza_population, | ||
max_service_area_population, | ||
max_service_area_sq_miles, | ||
sum_days_not_operated_emergencies, | ||
sum_days_not_operated_strikes, | ||
sum_days_of_service_operated, | ||
sum_trains_in_operation, | ||
sum_ada_upt, | ||
sum_sponsored_service_upt, | ||
sum_unlinked_passenger_trips_upt, | ||
sum_actual_vehicles_passenger_car_deadhead_hours, | ||
sum_actual_vehicles_passenger_car_hours, | ||
sum_actual_vehicles_passenger_car_revenue_hours, | ||
sum_charter_service_hours, | ||
sum_school_bus_hours, | ||
sum_train_deadhead_hours, | ||
sum_train_hours, | ||
sum_train_revenue_hours, | ||
sum_actual_vehicles_passenger_car_miles, | ||
sum_actual_vehicles_passenger_car_revenue_miles, | ||
sum_actual_vehicles_passenger_deadhead_miles, | ||
sum_directional_route_miles, | ||
sum_passenger_miles, | ||
sum_scheduled_vehicles_passenger_car_revenue_miles, | ||
sum_train_miles, | ||
sum_train_deadhead_miles, | ||
sum_train_revenue_miles | ||
FROM source |
Oops, something went wrong.