Skip to content

Commit

Permalink
Fix asset names without dbt syntax in `qc.vw_change_in_ahsap_values.s…
Browse files Browse the repository at this point in the history
…ql` (#550)

* Use dbt ref syntax for view names

* Change ccao.aprvl_reascd.reascd to string type

* Fix more hard-coded asset refs

* More dbt refs
  • Loading branch information
wrridgeway authored Jul 18, 2024
1 parent 96cac48 commit 771eab2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbt/models/default/default.vw_pin_condo_char.sql
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ FROM filled
LEFT JOIN aggregate_land
ON filled.pin = aggregate_land.parid
AND filled.year = aggregate_land.taxyr
LEFT JOIN default.vw_pin_history AS vph
LEFT JOIN {{ ref('default.vw_pin_history') }} AS vph
ON filled.pin = vph.pin
AND filled.year = vph.year
LEFT JOIN {{ source('ccao', 'pin_nonlivable') }} AS nonlivable
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/default/default.vw_pin_value.sql
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ LEFT JOIN change_reasons AS reasons
ON vals.pin = reasons.pin
AND vals.year = reasons.year
AND vals.stage_name = reasons.stage_name
LEFT JOIN ccao.aprval_reascd AS descr
LEFT JOIN {{ ref('ccao.aprval_reascd') }} AS descr
ON reasons.reascd = descr.reascd
4 changes: 2 additions & 2 deletions dbt/models/qc/qc.vw_change_in_ahsap_values.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SELECT
hist.board_class,
hist.board_tot,
hist.board_tot > hist.certified_tot * 1.2 AS large_board_increase
FROM default.vw_pin_history AS hist
INNER JOIN reporting.vw_pin_township_class AS ahsap
FROM {{ ref('default.vw_pin_history') }} AS hist
INNER JOIN {{ ref('reporting.vw_pin_township_class') }} AS ahsap
ON hist.pin = ahsap.pin AND hist.year = ahsap.year
WHERE ahsap.ahsap
AND (
Expand Down
4 changes: 4 additions & 0 deletions dbt/seeds/ccao/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ seeds:

- name: ccao.aprval_reascd
description: '{{ doc("seed_aprval_reascd") }}'
config:
column_types:
reascd: string
description: string

- name: ccao.class_dict
description: '{{ doc("seed_class_dict") }}'
Expand Down

0 comments on commit 771eab2

Please sign in to comment.