Skip to content

Commit

Permalink
fixed mart model sql to correctly reference stagin tables, remove unr…
Browse files Browse the repository at this point in the history
…eferenced config
  • Loading branch information
charlie-costanzo committed Nov 22, 2024
1 parent 94c79e5 commit a825e5b
Show file tree
Hide file tree
Showing 35 changed files with 35 additions and 37 deletions.
2 changes: 0 additions & 2 deletions warehouse/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,3 @@ models:
schema: mart_ntd_validation
ntd_fct_annual:
schema: mart_ntd_fct_annual
ntd_ridership:
schema: mart_ntd_ridership
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_breakdowns AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__breakdowns') }}
FROM {{ ref('stg_ntd_annual_data__breakdowns') }}
),

fct_ntd_annual_data__breakdowns AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
WITH staging_breakdowns_by_agency AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__breakdowns_by_agency') }}
FROM {{ ref('stg_ntd_annual_data__breakdowns_by_agency') }}
),
-- test

fct_ntd_annual_data__breakdowns_by_agency AS (
SELECT *
FROM staging_breakdowns_by_agency
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_capital_expenses_by_capital_use AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__capital_expenses_by_capital_use') }}
FROM {{ ref('stg_ntd_annual_data__capital_expenses_by_capital_use') }}
),

fct_ntd_annual_data__capital_expenses_by_capital_use AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_capital_expenses_by_mode AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__capital_expenses_by_mode') }}
FROM {{ ref('stg_ntd_annual_data__capital_expenses_by_mode') }}
),

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

fct_ntd_annual_data__capital_expenses_for_existing_service AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_capital_expenses_for_expansion_of_service AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__capital_expenses_for_expansion_of_service') }}
FROM {{ ref('stg_ntd_annual_data__capital_expenses_for_expansion_of_service') }}
),

fct_ntd_annual_data__capital_expenses_for_expansion_of_service AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_employees_by_agency AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__employees_by_agency') }}
FROM {{ ref('stg_ntd_annual_data__employees_by_agency') }}
),

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

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

fct_ntd_annual_data__employees_by_mode_and_employee_type AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_fuel_and_energy AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__fuel_and_energy') }}
FROM {{ ref('stg_ntd_annual_data__fuel_and_energy') }}
),

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

fct_ntd_annual_data__fuel_and_energy_by_agency AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_funding_sources_by_expense_type AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__funding_sources_by_expense_type') }}
FROM {{ ref('stg_ntd_annual_data__funding_sources_by_expense_type') }}
),

fct_ntd_annual_data__funding_sources_by_expense_type AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_funding_sources_directly_generated AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__funding_sources_directly_generated') }}
FROM {{ ref('stg_ntd_annual_data__funding_sources_directly_generated') }}
),

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

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

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

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

fct_ntd_annual_data__funding_sources_taxes_levied_by_agency AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_maintenance_facilities AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__maintenance_facilities') }}
FROM {{ ref('stg_ntd_annual_data__maintenance_facilities') }}
),

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

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

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

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

fct_ntd_annual_data__operating_expenses_by_function_and_agency AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_operating_expenses_by_type AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__operating_expenses_by_type') }}
FROM {{ ref('stg_ntd_annual_data__operating_expenses_by_type') }}
),

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

fct_ntd_annual_data__operating_expenses_by_type_and_agency AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_service_by_agency AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__service_by_agency') }}
FROM {{ ref('stg_ntd_annual_data__service_by_agency') }}
),

fct_ntd_annual_data__service_by_agency AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_service_by_mode AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__service_by_mode') }}
FROM {{ ref('stg_ntd_annual_data__service_by_mode') }}
),

fct_ntd_annual_data__service_by_mode AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_service_by_mode_and_time_period AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__service_by_mode_and_time_period') }}
FROM {{ ref('stg_ntd_annual_data__service_by_mode_and_time_period') }}
),

fct_ntd_annual_data__service_by_mode_and_time_period AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_stations_and_facilities_by_agency_and_facility_type AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__stations_and_facilities_by_agency_and_facility_type') }}
FROM {{ ref('stg_ntd_annual_data__stations_and_facilities_by_agency_and_facility_type') }}
),

fct_ntd_annual_data__stations_and_facilities_by_agency_and_facility_type AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_stations_by_mode_and_age AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__stations_by_mode_and_age') }}
FROM {{ ref('stg_ntd_annual_data__stations_by_mode_and_age') }}
),

fct_ntd_annual_data__stations_by_mode_and_age AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_track_and_roadway_by_agency AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__track_and_roadway_by_agency') }}
FROM {{ ref('stg_ntd_annual_data__track_and_roadway_by_agency') }}
),

fct_ntd_annual_data__track_and_roadway_by_agency AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_track_and_roadway_by_mode AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__track_and_roadway_by_mode') }}
FROM {{ ref('stg_ntd_annual_data__track_and_roadway_by_mode') }}
),

fct_ntd_annual_data__track_and_roadway_by_mode AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_track_and_roadway_guideway_age_distribution AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__track_and_roadway_guideway_age_distribution') }}
FROM {{ ref('stg_ntd_annual_data__track_and_roadway_guideway_age_distribution') }}
),

fct_ntd_annual_data__track_and_roadway_guideway_age_distribution AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_vehicles_age_distribution AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__vehicles_age_distribution') }}
FROM {{ ref('stg_ntd_annual_data__vehicles_age_distribution') }}
),

fct_ntd_annual_data__vehicles_age_distribution AS (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WITH staging_vehicles_type_count_by_agency AS (
SELECT *
FROM {{ ref('staging', 'stg_ntd_annual_data__vehicles_type_count_by_agency') }}
FROM {{ ref('stg_ntd_annual_data__vehicles_type_count_by_agency') }}
),

fct_ntd_annual_data__vehicles_type_count_by_agency AS (
Expand Down

0 comments on commit a825e5b

Please sign in to comment.