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

Small edits to dbt tests based on feedback #377

Closed jeancochrane closed 5 months ago

jeancochrane commented 5 months ago

This PR makes a number of small edits to our dbt tests as described in https://github.com/ccao-data/data-architecture/issues/371. See that issue for a full list of the changes.

There are a few changes from the list that I haven't made yet. I'm curious to get your take:

select oby.class, failures.*
from z_dev_jecochr_test_failure.iasworld_oby_card_between_1_and_100 failures
join iasworld.oby oby
    on oby.parid = failures.parid
    and oby.taxyr = failures.taxyr
    and oby.cur = 'Y'
    and oby.deactivat is null
select * from z_dev_jecochr_test_failure.iasworld_dweldat_char_ncu_between_0_and_5
jeancochrane commented 5 months ago

Thanks for the detailed review @dfsnow! I left clarifying questions on two of your comments and made fixes based on the rest. This should be ready for another look.

Unrelated to your review, I also decided to split out iasworld_dweldat_sfla_matches_class_definition into individual tests based on class in f124704, which I think makes for a clearer workbook reading experience. Now the description states exactly what the square footage should be for the record's class. You can run just this new set of tests if you'd like to see what the output looks like:

dbt test --store-failures --select \
    iasworld_dweldat_sfla_between_1_and_999_for_class_202
    iasworld_dweldat_sfla_between_1000_and_1800_for_class_203
    iasworld_dweldat_sfla_between_1801_and_25000_for_class_204
    iasworld_dweldat_sfla_between_1_and_2200_for_class_205
    iasworld_dweldat_sfla_between_2201_and_4999_for_class_206
    iasworld_dweldat_sfla_between_1_and_2000_for_class_207
    iasworld_dweldat_sfla_between_3801_and_4999_for_class_208
    iasworld_dweldat_sfla_between_5000_and_50000_for_class_209
    iasworld_dweldat_sfla_between_1_and_10000_for_class_210
    iasworld_dweldat_sfla_between_1_and_40000_for_class_211
    iasworld_dweldat_sfla_between_1_and_20000_for_class_212
    iasworld_dweldat_sfla_between_1_and_10000_for_class_234
    iasworld_dweldat_sfla_between_2001_and_3800_for_class_278
    iasworld_dweldat_sfla_between_1_and_20000_for_class_295