ccao-data / data-architecture

Codebase for CCAO data infrastructure construction and management
https://ccao-data.github.io/data-architecture/
6 stars 4 forks source link

Adjust `mktadj` tests to reflect the switch to `external_occpct`and new `5B` code #404

Closed jeancochrane closed 5 months ago

jeancochrane commented 5 months ago

In 2023, we began migrating from the mktadj column to the external_occpct column on dweldat, comdat, and oby. Prior to 2023, only mktadj should be populated in cases of fractional occupancy; in 2023, either mktadj or external_occpct (but not both) can be populated, representing the time when the fields were in transition; and starting in 2024, only external_occpct should be populated.

At the same time, we recently added "5B" as a valid option for chgrsn and mktrsn to help differentiate between 1-year reductions issued by our office and the board of review.

This PR adjusts our tests for the mktadj, mktrsn, and chgrsn columns on dweldat, comdat, and oby to reflect these two changes.

Closes #399.

Run the tests to ensure they execute properly:

dbt test --select \
    iasworld_comdat_chgrsn_eq_5_or_5b_when_external_occpct_or_mktadj_not_null \
    iasworld_comdat_external_occpct_not_null_when_chgrsn_eq_5_or_5b_and_mktadj_is_null \
    iasworld_comdat_mktadj_not_null_when_chgrsn_eq_5_or_5b_and_external_occpct_is_null \
    iasworld_dweldat_external_occpct_not_null_when_mktrsn_eq_5_or_5b_and_mktadj_is_null \
    iasworld_dweldat_mktadj_not_null_when_mktrsn_eq_5_or_5b_and_external_occpct_is_null \
    iasworld_dweldat_mktrsn_eq_5_or_5b_when_external_occpct_or_mktadj_not_null \
    iasworld_oby_chgrsn_eq_5_or_5b_when_external_occpct_or_mktadj_not_null \
    iasworld_oby_external_occpct_not_null_when_chgrsn_eq_5_or_5b_and_mktadj_is_null \
    iasworld_oby_mktadj_not_null_when_chgrsn_eq_5_or_5b_and_external_occpct_is_null