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 data tests for HIE fields #427

Closed Damonamajor closed 3 weeks ago

Damonamajor commented 2 months ago

This produces three tests regarding the tot_30 field.

asmt_all_tot30_less_than_7500

iasworld_asmt_all_tot30_matches_oby_ovrrcnld_divided_by_10

iasword_asmt_all_32_equals_29_minus_30_minus_31

The equation written out is

ASSD TOT -(HIE-DVHE) = ASSD TOT EXC AG - HIE - DVHE

wrridgeway commented 1 month ago

@dfsnow Have we talked to Mirella about these assumptions? I'm a little wary of incorporating iasworld dbt tests based on a hunch. I'm happy to be the one who reaches out.

dfsnow commented 1 month ago

@dfsnow Have we talked to Mirella about these assumptions? I'm a little wary of incorporating iasworld dbt tests based on a hunch. I'm happy to be the one who reaches out.

Not yet, it's on my list of stuff to talk to her about.

Damonamajor commented 1 month ago

@dfsnow Here are the errors when compiling the test for tot30 being 10% of oby.ovrrcnld 733a0ed3-8349-4aeb-ad12-df18d6da0d2f.csv

Damonamajor commented 1 month ago

@dfsnow Here's a sample of 10 pins pulled from the following query

SELECT parid, tot30
FROM (
    SELECT parid, tot30,
           ROW_NUMBER() OVER (PARTITION BY parid ORDER BY tot30 DESC) as rn
    FROM iasworld.asmt_all
    WHERE tot30 > 7500
) subquery
WHERE rn = 1
LIMIT 10;

d000cbc2-fc55-4c37-9f05-4a834f477270.csv

dfsnow commented 1 month ago

@Damonamajor Please wrap use markdown code blocks when commenting with code.

Also, you seem to have accidentally committed the DHI index script to this branch.

I can close out this branch myself after confirming some stuff with Mirella.

wrridgeway commented 1 month ago

I reached out to Mirella, and tot30 is indeed HIE AV amount

dfsnow commented 3 weeks ago

@wrridgeway @jeancochrane this should be set to go. It has no failures for the new tests (at least in TY 2024).