Skip to content

Commit

Permalink
Merge pull request #189 from cagov/schema_file_and_directory_name_cha…
Browse files Browse the repository at this point in the history
…nges_04_2024

changed instances of "pems" in model names to "diagnostics" renamed "detector_health_diag" schema and folder to "diagnostics"
  • Loading branch information
ian-r-rose authored Apr 29, 2024
2 parents 2200aa3 + 12f4e61 commit 3408e37
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions transform/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ models:
+materialized: view
clearinghouse:
+schema: clearinghouse
detector_health_diag:
+schema: detector_health
diagnostics:
+schema: diagnostics
performance:
+schema: performance
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

models:
- name: int_pems__det_diag_set_assignment
- name: int_diagnostics__det_diag_set_assignment
description: |
This SQL file assigns diagnostic threshold values used for detector healh at the
station level based on the district and type of station while also bringing in
Expand Down Expand Up @@ -83,7 +83,7 @@ models:
Finding the right metadata for a date should involve a check with
`_VALID_FROM <= date < _VALID_TO`.
- name: int_pems__diagnostic_samples_per_station
- name: int_diagnostics__samples_per_station
description: |
This file contains count data by station and lane based on the number of raw data samples
that met a variety of flow and occupancy criteria. This data will be used to determine the
Expand Down Expand Up @@ -132,7 +132,7 @@ models:
Counts the number of occupancy values in a lane that exceeded the high value threshold
detector diagnostic parameter for a station.
- name: int_pems__detector_status
- name: int_diagnostics__detector_status
description: |
This file contains count data by station and lane based on the 30 second raw data
along with a diagnostic value associated with the station type and count results.
Expand All @@ -144,7 +144,7 @@ models:
tests:
- not_null

- name: int_pems__constant_occupancy
- name: int_diagnostics__constant_occupancy
description: |
This model calculates constant occupancy by first calculating the delta
between occupancy and previous occupancy. It then takes the absolute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with

source as (
select * from {{ ref('int_pems__diagnostic_samples_per_station') }}
select * from {{ ref('int_diagnostics__samples_per_station') }}
{% if is_incremental() %}
-- Look back to account for any late-arriving data
where
Expand Down Expand Up @@ -82,7 +82,7 @@ detector_status as (
--Feed unstable case needed
else 'Good'
end as status
from {{ ref('int_pems__det_diag_set_assignment') }} as set_assgnmt
from {{ ref('int_diagnostics__det_diag_set_assignment') }} as set_assgnmt
left join source as sps
on
set_assgnmt.station_id = sps.station_id
Expand All @@ -92,7 +92,7 @@ detector_status as (
set_assgnmt.station_valid_to > sps.sample_date
or set_assgnmt.station_valid_to is null
)
left join {{ ref('int_pems__constant_occupancy') }} as co
left join {{ ref('int_diagnostics__constant_occupancy') }} as co
on
sps.station_id = co.id and sps.lane = co.lane and sps.sample_date = co.sample_date
)
Expand Down
4 changes: 2 additions & 2 deletions transform/package-lock.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
packages:
- package: dbt-labs/dbt_utils
version: 1.1.1
- package: dbt-labs/dbt_utils
version: 1.1.1
sha1_hash: a158c48c59c2bb7d729d2a4e215aabe5bb4f3353

0 comments on commit 3408e37

Please sign in to comment.