diff --git a/changelog.d/fix-codehealth-ar-sra-wa-wccc.fixed.md b/changelog.d/fix-codehealth-ar-sra-wa-wccc.fixed.md new file mode 100644 index 00000000000..43a858bba90 --- /dev/null +++ b/changelog.d/fix-codehealth-ar-sra-wa-wccc.fixed.md @@ -0,0 +1 @@ +Fixed two code-health regressions on main: precompute per-person arrays in `ar_sra_countable_income` (replaces `sum()` over an entity-variable generator), and switch `wa_wccc_provider_type.defined_for` from `"wa_wccc_eligible_child"` to `StateCode.WA` so an input variable no longer carries a non-geographic gate. diff --git a/policyengine_us/variables/gov/states/ar/ade/oec/sra/income/ar_sra_countable_income.py b/policyengine_us/variables/gov/states/ar/ade/oec/sra/income/ar_sra_countable_income.py index dbeb694537a..9289b238bb9 100644 --- a/policyengine_us/variables/gov/states/ar/ade/oec/sra/income/ar_sra_countable_income.py +++ b/policyengine_us/variables/gov/states/ar/ade/oec/sra/income/ar_sra_countable_income.py @@ -18,5 +18,6 @@ def formula(spm_unit, period, parameters): # FSU ยง4.3.2 excludes children's SSI and Social Security; mask by adult status. person = spm_unit.members is_adult = person("age", period.this_year) >= p.eligibility.adult_age_threshold - per_person_income = sum(person(source, period) for source in p.income.sources) + per_person_components = [person(source, period) for source in p.income.sources] + per_person_income = sum(per_person_components) return spm_unit.sum(per_person_income * is_adult) diff --git a/policyengine_us/variables/gov/states/wa/dcyf/wccc/payment/wa_wccc_provider_type.py b/policyengine_us/variables/gov/states/wa/dcyf/wccc/payment/wa_wccc_provider_type.py index 46866f2ea60..284b719f468 100644 --- a/policyengine_us/variables/gov/states/wa/dcyf/wccc/payment/wa_wccc_provider_type.py +++ b/policyengine_us/variables/gov/states/wa/dcyf/wccc/payment/wa_wccc_provider_type.py @@ -17,7 +17,7 @@ class wa_wccc_provider_type(Variable): default_value = WAWCCCProviderType.CENTER definition_period = MONTH label = "Washington WCCC child care provider type" - defined_for = "wa_wccc_eligible_child" + defined_for = StateCode.WA reference = ( "https://app.leg.wa.gov/wac/default.aspx?cite=110-15-0200", "https://app.leg.wa.gov/wac/default.aspx?cite=110-15-0205",