Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose all ntd annual reporting staging tables as mart #3550

Merged
merged 6 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions warehouse/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ models:
schema: mart_benefits
ntd_validation:
schema: mart_ntd_validation
ntd_fct_annual:
schema: mart_ntd_fct_annual
102 changes: 102 additions & 0 deletions warehouse/models/mart/ntd_fct_annual/_mart_ntd_fct_annual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
version: 2

x-common-fields:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These common fields are not in use here. I think would be better to add when adding documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good catch, removed!

- &ntd_id
name: ntd_id
description: '{{ doc("ntd_id") }}'
- &agency
name: agency
description: '{{ doc("ntd_agency") }}'
- &ntd_legacy_id
name: ntd_legacy_id
description: '{{ doc("ntd_legacy_id") }}'
- &report_year
name: report_year
description: '{{ doc("ntd_report_year") }}'
- &reporter_type
name: reporter_type
description: '{{ doc("ntd_reporter_type") }}'
- &organization_type
name: organization_type
description: '{{ doc("ntd_organization_type") }}'
- &city
name: city
description: '{{ doc("ntd_city") }}'
- &state
name: state
description: '{{ doc("ntd_state") }}'
- &primary_uza_code
name: primary_uza_code
description: '{{ doc("ntd_primary_uza_code") }}'
- &primary_uza_name
name: primary_uza_name
description: '{{ doc("ntd_primary_uza_name") }}'
- &primary_uza_area_sq_miles
name: primary_uza_area_sq_miles
description: '{{ doc("ntd_primary_uza_area_sq_miles") }}'
- &primary_uza_population
name: primary_uza_population
description: '{{ doc("ntd_primary_uza_population") }}'
- &service_area_population
name: service_area_population
description: '{{ doc("ntd_service_area_population") }}'
- &service_area_sq_miles
name: service_area_sq_miles
description: '{{ doc("ntd_service_area_sq_miles") }}'
- &type_of_service
name: type_of_service
description: '{{ doc("ntd_type_of_service") }}'
- &mode
name: mode
description: '{{ doc("ntd_mode") }}'
- &mode_name
name: mode_name
description: '{{ doc("ntd_mode_name") }}'
- &time_period
name: time_period
description: '{{ doc("ntd_time_period") }}'
- &questionable_data
name: questionable_data
description: '{{ doc("ntd_questionable_data") }}'
- &agency_voms
name: agency_voms
description: '{{ doc("ntd_agency_voms") }}'
- &actual_vehicle_hours
name: actual_vehicle_hours
description: '{{ doc("ntd_actual_vehicle_hours") }}'

models:
erikamov marked this conversation as resolved.
Show resolved Hide resolved
- name: fct_ntd_annual_data__stations_and_facilities_by_agency_and_facility_type
- name: fct_ntd_annual_data__stations_by_mode_and_age
- name: fct_ntd_annual_data__operating_expenses_by_function
- name: fct_ntd_annual_data__operating_expenses_by_function_and_agency
- name: fct_ntd_annual_data__operating_expenses_by_type
- name: fct_ntd_annual_data__operating_expenses_by_type_and_agency
- name: fct_ntd_annual_data__vehicles_age_distribution
- name: fct_ntd_annual_data__vehicles_type_count_by_agency
- name: fct_ntd_annual_data__service_by_mode_and_time_period
- name: fct_ntd_annual_data__service_by_mode
- name: fct_ntd_annual_data__service_by_agency
- name: fct_ntd_annual_data__track_and_roadway_by_mode
- name: fct_ntd_annual_data__track_and_roadway_guideway_age_distribution
- name: fct_ntd_annual_data__track_and_roadway_by_agency
- name: fct_ntd_annual_data__metrics
- name: fct_ntd_annual_data__funding_sources_by_expense_type
- name: fct_ntd_annual_data__funding_sources_directly_generated
- name: fct_ntd_annual_data__funding_sources_taxes_levied_by_agency
- name: fct_ntd_annual_data__funding_sources_local
- name: fct_ntd_annual_data__funding_sources_state
- name: fct_ntd_annual_data__funding_sources_federal
- name: fct_ntd_annual_data__maintenance_facilities
- name: fct_ntd_annual_data__maintenance_facilities_by_agency
- name: fct_ntd_annual_data__fuel_and_energy
- name: fct_ntd_annual_data__fuel_and_energy_by_agency
- name: fct_ntd_annual_data__employees_by_mode_and_employee_type
- name: fct_ntd_annual_data__employees_by_mode
- name: fct_ntd_annual_data__employees_by_agency
- name: fct_ntd_annual_data__capital_expenses_by_capital_use
- name: fct_ntd_annual_data__capital_expenses_by_mode
- name: fct_ntd_annual_data__capital_expenses_for_existing_service
- name: fct_ntd_annual_data__capital_expenses_for_expansion_of_service
- name: fct_ntd_annual_data__breakdowns
- name: fct_ntd_annual_data__breakdowns_by_agency
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_breakdowns AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__breakdowns') }}
),

fct_ntd_annual_data__breakdowns AS (
SELECT *
FROM staging_breakdowns
)

SELECT * FROM fct_ntd_annual_data__breakdowns
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_breakdowns_by_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__breakdowns_by_agency') }}
),

fct_ntd_annual_data__breakdowns_by_agency AS (
SELECT *
FROM staging_breakdowns_by_agency
)

SELECT * FROM fct_ntd_annual_data__breakdowns_by_agency
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_capital_expenses_by_capital_use AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__capital_expenses_by_capital_use') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_capital_expenses_by_mode AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__capital_expenses_by_mode') }}
),

fct_ntd_annual_data__capital_expenses_by_mode AS (
SELECT *
FROM staging_capital_expenses_by_mode
)

SELECT * FROM fct_ntd_annual_data__capital_expenses_by_mode
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_capital_expenses_for_existing_service AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__capital_expenses_for_existing_service') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_capital_expenses_for_expansion_of_service AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__capital_expenses_for_expansion_of_service') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_employees_by_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__employees_by_agency') }}
),

fct_ntd_annual_data__employees_by_agency AS (
SELECT *
FROM staging_employees_by_agency
)

SELECT * FROM fct_ntd_annual_data__employees_by_agency
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_employees_by_mode AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__employees_by_mode') }}
),

fct_ntd_annual_data__employees_by_mode AS (
SELECT *
FROM staging_employees_by_mode
)

SELECT * FROM fct_ntd_annual_data__employees_by_mode
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_employees_by_mode_and_employee_type AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__employees_by_mode_and_employee_type') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_fuel_and_energy AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__fuel_and_energy') }}
),

fct_ntd_annual_data__fuel_and_energy AS (
SELECT *
FROM staging_fuel_and_energy
)

SELECT * FROM fct_ntd_annual_data__fuel_and_energy
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_fuel_and_energy_by_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__fuel_and_energy_by_agency') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_funding_sources_by_expense_type AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__funding_sources_by_expense_type') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_funding_sources_directly_generated AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__funding_sources_directly_generated') }}
),

fct_ntd_annual_data__funding_sources_directly_generated AS (
SELECT *
FROM staging_funding_sources_directly_generated
)

SELECT * FROM fct_ntd_annual_data__funding_sources_directly_generated
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_funding_sources_federal AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__funding_sources_federal') }}
),

fct_ntd_annual_data__funding_sources_federal AS (
SELECT *
FROM staging_funding_sources_federal
)

SELECT * FROM fct_ntd_annual_data__funding_sources_federal
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_funding_sources_local AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__funding_sources_local') }}
),

fct_ntd_annual_data__funding_sources_local AS (
SELECT *
FROM staging_funding_sources_local
)

SELECT * FROM fct_ntd_annual_data__funding_sources_local
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_funding_sources_state AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__funding_sources_state') }}
),

fct_ntd_annual_data__funding_sources_state AS (
SELECT *
FROM staging_funding_sources_state
)

SELECT * FROM fct_ntd_annual_data__funding_sources_state
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_funding_sources_taxes_levied_by_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__funding_sources_taxes_levied_by_agency') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_maintenance_facilities AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__maintenance_facilities') }}
),

fct_ntd_annual_data__maintenance_facilities AS (
SELECT *
FROM staging_maintenance_facilities
)

SELECT * FROM fct_ntd_annual_data__maintenance_facilities
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_maintenance_facilities_by_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__maintenance_facilities_by_agency') }}
),

fct_ntd_annual_data__maintenance_facilities_by_agency AS (
SELECT *
FROM staging_maintenance_facilities_by_agency
)

SELECT * FROM fct_ntd_annual_data__maintenance_facilities_by_agency
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_metrics AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__metrics') }}
),

fct_ntd_annual_data__metrics AS (
SELECT *
FROM staging_metrics
)

SELECT * FROM fct_ntd_annual_data__metrics
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_operating_expenses_by_function AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__operating_expenses_by_function') }}
),

fct_ntd_annual_data__operating_expenses_by_function AS (
SELECT *
FROM staging_operating_expenses_by_function
)

SELECT * FROM fct_ntd_annual_data__operating_expenses_by_function
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_operating_expenses_by_function_and_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__operating_expenses_by_function_and_agency') }}
),

fct_ntd_annual_data__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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_operating_expenses_by_type AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__operating_expenses_by_type') }}
),

fct_ntd_annual_data__operating_expenses_by_type AS (
SELECT *
FROM staging_operating_expenses_by_type
)

SELECT * FROM fct_ntd_annual_data__operating_expenses_by_type
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
WITH staging_operating_expenses_by_type_and_agency AS (
SELECT *
FROM {{ ref('stg_ntd_annual_data__operating_expenses_by_type_and_agency') }}
),

fct_ntd_annual_data__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
Loading
Loading