Skip to content

Fix Arizona AGI calculation - exemptions should not be included in AGI #6988

@DTrim99

Description

@DTrim99

Summary

The current az_agi variable incorrectly subtracts Arizona exemptions (aged, blind, etc.) as part of AGI. Per Arizona Form 140 and tax statutes, exemptions are subtracted after AGI is calculated, not as part of AGI itself.

This causes issues for any calculation that uses az_agi expecting it to be true Arizona AGI.

Current Implementation

File: policyengine_us/variables/gov/states/az/tax/income/az_agi.py

def formula(tax_unit, period, parameters):
    adjusted_gross_income = tax_unit("adjusted_gross_income", period)
    additions = tax_unit("az_additions", period)
    subtractions = tax_unit("az_subtractions", period)
    exemptions = tax_unit("az_exemptions", period)  # <-- WRONG

    return max_(
        0, adjusted_gross_income + additions - subtractions - exemptions  # <-- WRONG
    )

What Arizona Form 140 Shows

Line Description Formula
12 Federal AGI -
13-36 Additions and Subtractions -
37 Arizona AGI Fed AGI + additions - subtractions
38-42 Exemptions -
43 AZ AGI minus exemptions Line 37 - exemptions
44 Deductions -
45 Taxable Income Line 43 - deductions

Impact

1. Family Tax Credit (ARS 43-1073)

The statute says eligibility is based on:

"Arizona adjusted gross income, plus the amount subtracted for exemptions"

This means the Family Tax Credit should use true Arizona AGI (before exemptions). But currently it uses az_agi which already has exemptions subtracted, resulting in incorrect eligibility calculations.

File: policyengine_us/variables/gov/states/az/tax/income/credits/family_tax_credit/az_family_tax_credit_eligible.py

2. Any other variable using az_agi

Any variable expecting true Arizona AGI will get the wrong value.

Suggested Fix

Option 1: Rename and create new variable (Recommended)

  1. Rename az_agi to az_agi_less_exemptions (or similar)
  2. Create new az_agi that equals Fed AGI + additions - subtractions (no exemptions)
  3. Update az_taxable_income to use az_agi_less_exemptions
  4. Update az_family_tax_credit_eligible to use the new true az_agi

Option 2: Fix in place

  1. Remove exemptions from az_agi calculation
  2. Create az_agi_less_exemptions for use in az_taxable_income
  3. Update downstream variables accordingly

Files to Modify

  • policyengine_us/variables/gov/states/az/tax/income/az_agi.py
  • policyengine_us/variables/gov/states/az/tax/income/az_taxable_income.py
  • policyengine_us/variables/gov/states/az/tax/income/credits/family_tax_credit/az_family_tax_credit_eligible.py
  • Tests in policyengine_us/tests/policy/baseline/gov/states/az/tax/income/

References

Instructions for Bot

To fix this issue:

  1. Create a new variable az_agi_less_exemptions that equals az_agi - az_exemptions (using the corrected az_agi)

  2. Update az_agi.py to NOT subtract exemptions:

    return max_(0, adjusted_gross_income + additions - subtractions)
  3. Update az_taxable_income.py to use the new flow:

    az_agi = tax_unit("az_agi", period)
    exemptions = tax_unit("az_exemptions", period)
    deductions = tax_unit("az_deductions", period)
    return max_(0, az_agi - exemptions - deductions)
  4. Update az_family_tax_credit_eligible.py - it should now work correctly with the fixed az_agi

  5. Update tests in az_agi.yaml to reflect the new calculation (without exemptions)

  6. Run all Arizona tests to ensure nothing breaks:

    policyengine-core test policyengine_us/tests/policy/baseline/gov/states/az/ -c policyengine_us
  7. Add changelog entry describing the fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions