Skip to content

Commit

Permalink
rename ntd mart tables, expose ridership tables as mart
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-costanzo committed Dec 16, 2024
1 parent 394aab1 commit d3cca95
Show file tree
Hide file tree
Showing 53 changed files with 234 additions and 123 deletions.
39 changes: 39 additions & 0 deletions warehouse/models/mart/annual_reporting/_mart_annual_reporting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2

models:
- name: fct_breakdowns
- name: fct_breakdowns_by_agency
- name: fct_capital_expenses_by_capital_use
- name: fct_capital_expenses_by_mode
- name: fct_capital_expenses_for_existing_service
- name: fct_capital_expenses_for_expansion_of_service
- name: fct_employees_by_agency
- name: fct_employees_by_mode
- name: fct_employees_by_mode_and_employee_type
- name: fct_fuel_and_energy
- name: fct_fuel_and_energy_by_agency
- name: fct_funding_sources_by_expense_type
- name: fct_funding_sources_directly_generated
- name: fct_funding_sources_federal
- name: fct_funding_sources_local
- name: fct_funding_sources_state
- name: fct_funding_sources_taxes_levied_by_agency
- name: fct_maintenance_facilities
- name: fct_maintenance_facilities_by_agency
- name: fct_metrics
- name: fct_operating_expenses_by_function
- name: fct_operating_expenses_by_function_and_agency
- name: fct_operating_expenses_by_type
- name: fct_operating_expenses_by_type_and_agency
- name: fct_service_by_agency
- name: fct_service_by_mode
- name: fct_service_by_mode_and_time_period
- name: fct_stations_and_facilities_by_agency_and_facility_type
- name: fct_stations_by_mode_and_age
- name: fct_track_and_roadway_by_agency
- name: fct_track_and_roadway_by_mode
- name: fct_track_and_roadway_guideway_age_distribution
- name: fct_vehicles_age_distribution
- name: fct_vehicles_type_count_by_agency
- name: dim_2023_agency_information
- name: fct_2023_contractual_relationships
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_agency_information AS (
FROM {{ ref('stg_ntd__2023_agency_information') }}
),

fct_ntd_annual_data__2023_agency_information AS (
dim_2023_agency_information AS (
SELECT *
FROM staging_agency_information
)

SELECT * FROM fct_ntd_annual_data__2023_agency_information
SELECT * FROM dim_2023_agency_information
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_contractual_relationships AS (
FROM {{ ref('stg_ntd__2023_contractual_relationships') }}
),

fct_ntd_annual_data__2023_contractual_relationships AS (
fct_2023_contractual_relationships AS (
SELECT *
FROM staging_contractual_relationships
)

SELECT * FROM fct_ntd_annual_data__2023_contractual_relationships
SELECT * FROM fct_2023_contractual_relationships
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_breakdowns AS (
FROM {{ ref('stg_ntd__breakdowns') }}
),

fct_ntd_annual_data__breakdowns AS (
fct_breakdowns AS (
SELECT *
FROM staging_breakdowns
)

SELECT * FROM fct_ntd_annual_data__breakdowns
SELECT * FROM fct_breakdowns
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_breakdowns_by_agency AS (
FROM {{ ref('stg_ntd__breakdowns_by_agency') }}
),

fct_ntd_annual_data__breakdowns_by_agency AS (
fct_breakdowns_by_agency AS (
SELECT *
FROM staging_breakdowns_by_agency
)

SELECT * FROM fct_ntd_annual_data__breakdowns_by_agency
SELECT * FROM fct_breakdowns_by_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_capital_expenses_by_capital_use AS (
FROM {{ ref('stg_ntd__capital_expenses_by_capital_use') }}
),

fct_ntd_annual_data__capital_expenses_by_capital_use AS (
fct_capital_expenses_by_capital_use AS (
SELECT *
FROM staging_capital_expenses_by_capital_use
)

SELECT * FROM fct_ntd_annual_data__capital_expenses_by_capital_use
SELECT * FROM fct_capital_expenses_by_capital_use
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_capital_expenses_by_mode AS (
FROM {{ ref('stg_ntd__capital_expenses_by_mode') }}
),

fct_ntd_annual_data__capital_expenses_by_mode AS (
fct_capital_expenses_by_mode AS (
SELECT *
FROM staging_capital_expenses_by_mode
)

SELECT * FROM fct_ntd_annual_data__capital_expenses_by_mode
SELECT * FROM fct_capital_expenses_by_mode
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_capital_expenses_for_existing_service AS (
FROM {{ ref('stg_ntd__capital_expenses_for_existing_service') }}
),

fct_ntd_annual_data__capital_expenses_for_existing_service AS (
fct_capital_expenses_for_existing_service AS (
SELECT *
FROM staging_capital_expenses_for_existing_service
)

SELECT * FROM fct_ntd_annual_data__capital_expenses_for_existing_service
SELECT * FROM fct_capital_expenses_for_existing_service
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_capital_expenses_for_expansion_of_service AS (
FROM {{ ref('stg_ntd__capital_expenses_for_expansion_of_service') }}
),

fct_ntd_annual_data__capital_expenses_for_expansion_of_service AS (
fct_capital_expenses_for_expansion_of_service AS (
SELECT *
FROM staging_capital_expenses_for_expansion_of_service
)

SELECT * FROM fct_ntd_annual_data__capital_expenses_for_expansion_of_service
SELECT * FROM fct_capital_expenses_for_expansion_of_service
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_employees_by_agency AS (
FROM {{ ref('stg_ntd__employees_by_agency') }}
),

fct_ntd_annual_data__employees_by_agency AS (
fct_employees_by_agency AS (
SELECT *
FROM staging_employees_by_agency
)

SELECT * FROM fct_ntd_annual_data__employees_by_agency
SELECT * FROM fct_employees_by_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_employees_by_mode AS (
FROM {{ ref('stg_ntd__employees_by_mode') }}
),

fct_ntd_annual_data__employees_by_mode AS (
fct_employees_by_mode AS (
SELECT *
FROM staging_employees_by_mode
)

SELECT * FROM fct_ntd_annual_data__employees_by_mode
SELECT * FROM fct_employees_by_mode
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_employees_by_mode_and_employee_type AS (
FROM {{ ref('stg_ntd__employees_by_mode_and_employee_type') }}
),

fct_ntd_annual_data__employees_by_mode_and_employee_type AS (
fct_employees_by_mode_and_employee_type AS (
SELECT *
FROM staging_employees_by_mode_and_employee_type
)

SELECT * FROM fct_ntd_annual_data__employees_by_mode_and_employee_type
SELECT * FROM fct_employees_by_mode_and_employee_type
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_fuel_and_energy AS (
FROM {{ ref('stg_ntd__fuel_and_energy') }}
),

fct_ntd_annual_data__fuel_and_energy AS (
fct_fuel_and_energy AS (
SELECT *
FROM staging_fuel_and_energy
)

SELECT * FROM fct_ntd_annual_data__fuel_and_energy
SELECT * FROM fct_fuel_and_energy
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_fuel_and_energy_by_agency AS (
FROM {{ ref('stg_ntd__fuel_and_energy_by_agency') }}
),

fct_ntd_annual_data__fuel_and_energy_by_agency AS (
fct_fuel_and_energy_by_agency AS (
SELECT *
FROM staging_fuel_and_energy_by_agency
)

SELECT * FROM fct_ntd_annual_data__fuel_and_energy_by_agency
SELECT * FROM fct_fuel_and_energy_by_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_funding_sources_by_expense_type AS (
FROM {{ ref('stg_ntd__funding_sources_by_expense_type') }}
),

fct_ntd_annual_data__funding_sources_by_expense_type AS (
fct_funding_sources_by_expense_type AS (
SELECT *
FROM staging_funding_sources_by_expense_type
)

SELECT * FROM fct_ntd_annual_data__funding_sources_by_expense_type
SELECT * FROM fct_funding_sources_by_expense_type
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_funding_sources_directly_generated AS (
FROM {{ ref('stg_ntd__funding_sources_directly_generated') }}
),

fct_ntd_annual_data__funding_sources_directly_generated AS (
fct_funding_sources_directly_generated AS (
SELECT *
FROM staging_funding_sources_directly_generated
)

SELECT * FROM fct_ntd_annual_data__funding_sources_directly_generated
SELECT * FROM fct_funding_sources_directly_generated
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_funding_sources_federal AS (
FROM {{ ref('stg_ntd__funding_sources_federal') }}
),

fct_ntd_annual_data__funding_sources_federal AS (
fct_funding_sources_federal AS (
SELECT *
FROM staging_funding_sources_federal
)

SELECT * FROM fct_ntd_annual_data__funding_sources_federal
SELECT * FROM fct_funding_sources_federal
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_funding_sources_local AS (
FROM {{ ref('stg_ntd__funding_sources_local') }}
),

fct_ntd_annual_data__funding_sources_local AS (
fct_funding_sources_local AS (
SELECT *
FROM staging_funding_sources_local
)

SELECT * FROM fct_ntd_annual_data__funding_sources_local
SELECT * FROM fct_funding_sources_local
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_funding_sources_state AS (
FROM {{ ref('stg_ntd__funding_sources_state') }}
),

fct_ntd_annual_data__funding_sources_state AS (
fct_funding_sources_state AS (
SELECT *
FROM staging_funding_sources_state
)

SELECT * FROM fct_ntd_annual_data__funding_sources_state
SELECT * FROM fct_funding_sources_state
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_funding_sources_taxes_levied_by_agency AS (
FROM {{ ref('stg_ntd__funding_sources_taxes_levied_by_agency') }}
),

fct_ntd_annual_data__funding_sources_taxes_levied_by_agency AS (
fct_funding_sources_taxes_levied_by_agency AS (
SELECT *
FROM staging_funding_sources_taxes_levied_by_agency
)

SELECT * FROM fct_ntd_annual_data__funding_sources_taxes_levied_by_agency
SELECT * FROM fct_funding_sources_taxes_levied_by_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_maintenance_facilities AS (
FROM {{ ref('stg_ntd__maintenance_facilities') }}
),

fct_ntd_annual_data__maintenance_facilities AS (
fct_maintenance_facilities AS (
SELECT *
FROM staging_maintenance_facilities
)

SELECT * FROM fct_ntd_annual_data__maintenance_facilities
SELECT * FROM fct_maintenance_facilities
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_maintenance_facilities_by_agency AS (
FROM {{ ref('stg_ntd__maintenance_facilities_by_agency') }}
),

fct_ntd_annual_data__maintenance_facilities_by_agency AS (
fct_maintenance_facilities_by_agency AS (
SELECT *
FROM staging_maintenance_facilities_by_agency
)

SELECT * FROM fct_ntd_annual_data__maintenance_facilities_by_agency
SELECT * FROM fct_maintenance_facilities_by_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_metrics AS (
FROM {{ ref('stg_ntd__metrics') }}
),

fct_ntd_annual_data__metrics AS (
fct_metrics AS (
SELECT *
FROM staging_metrics
)

SELECT * FROM fct_ntd_annual_data__metrics
SELECT * FROM fct_metrics
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_operating_expenses_by_function AS (
FROM {{ ref('stg_ntd__operating_expenses_by_function') }}
),

fct_ntd_annual_data__operating_expenses_by_function AS (
fct_operating_expenses_by_function AS (
SELECT *
FROM staging_operating_expenses_by_function
)

SELECT * FROM fct_ntd_annual_data__operating_expenses_by_function
SELECT * FROM fct_operating_expenses_by_function
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_operating_expenses_by_function_and_agency AS (
FROM {{ ref('stg_ntd__operating_expenses_by_function_and_agency') }}
),

fct_ntd_annual_data__operating_expenses_by_function_and_agency AS (
fct_operating_expenses_by_function_and_agency AS (
SELECT *
FROM staging_operating_expenses_by_function_and_agency
)

SELECT * FROM fct_ntd_annual_data__operating_expenses_by_function_and_agency
SELECT * FROM fct_operating_expenses_by_function_and_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_operating_expenses_by_type AS (
FROM {{ ref('stg_ntd__operating_expenses_by_type') }}
),

fct_ntd_annual_data__operating_expenses_by_type AS (
fct_operating_expenses_by_type AS (
SELECT *
FROM staging_operating_expenses_by_type
)

SELECT * FROM fct_ntd_annual_data__operating_expenses_by_type
SELECT * FROM fct_operating_expenses_by_type
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_operating_expenses_by_type_and_agency AS (
FROM {{ ref('stg_ntd__operating_expenses_by_type_and_agency') }}
),

fct_ntd_annual_data__operating_expenses_by_type_and_agency AS (
fct_operating_expenses_by_type_and_agency AS (
SELECT *
FROM staging_operating_expenses_by_type_and_agency
)

SELECT * FROM fct_ntd_annual_data__operating_expenses_by_type_and_agency
SELECT * FROM fct_operating_expenses_by_type_and_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_service_by_agency AS (
FROM {{ ref('stg_ntd__service_by_agency') }}
),

fct_ntd_annual_data__service_by_agency AS (
fct_service_by_agency AS (
SELECT *
FROM staging_service_by_agency
)

SELECT * FROM fct_ntd_annual_data__service_by_agency
SELECT * FROM fct_service_by_agency
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_service_by_mode AS (
FROM {{ ref('stg_ntd__service_by_mode') }}
),

fct_ntd_annual_data__service_by_mode AS (
fct_service_by_mode AS (
SELECT *
FROM staging_service_by_mode
)

SELECT * FROM fct_ntd_annual_data__service_by_mode
SELECT * FROM fct_service_by_mode
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_service_by_mode_and_time_period AS (
FROM {{ ref('stg_ntd__service_by_mode_and_time_period') }}
),

fct_ntd_annual_data__service_by_mode_and_time_period AS (
fct_service_by_mode_and_time_period AS (
SELECT *
FROM staging_service_by_mode_and_time_period
)

SELECT * FROM fct_ntd_annual_data__service_by_mode_and_time_period
SELECT * FROM fct_service_by_mode_and_time_period
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ WITH staging_stations_and_facilities_by_agency_and_facility_type AS (
FROM {{ ref('stg_ntd__stations_and_facilities_by_agency_and_facility_type') }}
),

fct_ntd_annual_data__stations_and_facilities_by_agency_and_facility_type AS (
fct_stations_and_facilities_by_agency_and_facility_type AS (
SELECT *
FROM staging_stations_and_facilities_by_agency_and_facility_type
)

SELECT * FROM fct_ntd_annual_data__stations_and_facilities_by_agency_and_facility_type
SELECT * FROM fct_stations_and_facilities_by_agency_and_facility_type
Loading

0 comments on commit d3cca95

Please sign in to comment.