ccao-data / data-architecture

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

Add a test to dweldat to make sure `yrblt` matches the class code #398

Closed jeancochrane closed 2 months ago

jeancochrane commented 2 months ago

In #377, we added a set of tests to iasworld.dweldat.sfla to confirm that a card's building square footage matches the square footage in its class definition. These class definitions also include restrictions on building age, so we should add a similar set of tests to the yrblt column to make sure that the building age matches the class definition.

For an example of this kind of test, see iasworld_dweldat_sfla_between_1_and_999_for_class_202.

Damonamajor commented 2 months ago

@jeancochrane @dfsnow Is there a minimum year that we use in our tests? Having it set to a determined amount does seem useful, since there may be dates like 199 instead of 1999.

dfsnow commented 2 months ago

Looks like it's 1850: https://github.com/ccao-data/data-architecture/blob/master/dbt/models/iasworld/schema/iasworld.dweldat.yml#L1512-L1519

jeancochrane commented 2 months ago

Perhaps a misclick, but I think this is actually the correct link to reference the current year minimum applied to yrblt: https://github.com/ccao-data/data-architecture/blob/66442f5a33153e33de914421967181dc53839c54/dbt/models/iasworld/schema/iasworld.dweldat.yml#L1561-L1568