Skip to content

Add US government bond interest exemption to IL, KS, MA, MD state income taxes (+ tests for IA, ID, IN, KY, LA, MI)#7673

Open
MaxGhenis wants to merge 2 commits intomainfrom
bond-interest-batch-2
Open

Add US government bond interest exemption to IL, KS, MA, MD state income taxes (+ tests for IA, ID, IN, KY, LA, MI)#7673
MaxGhenis wants to merge 2 commits intomainfrom
bond-interest-batch-2

Conversation

@MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Mar 3, 2026

Summary

This PR adds US government bond interest exemptions to 10 states' state income tax calculations. Bond interest from US government securities (Treasury bonds, notes, bills, etc.) is often exempt from state taxation. This change implements that exemption across multiple state tax systems.

Changes

Code changes (4 states needed implementation):

  • Illinois (IL): Added il_us_govt_interest_subtraction variable to state income base subtractions
  • Kansas (KS): Added ks_us_govt_interest_subtraction variable to AGI subtractions calculation
  • Massachusetts (MA): Added ma_us_govt_interest_subtraction variable and updated Part B AGI logic to exclude it from taxable income
  • Maryland (MD): Added md_us_govt_interest_subtraction variable to AGI subtractions

Test-only additions (6 states already had parameters):

  • Iowa (IA): Added ia_us_govt_interest_subtraction test cases
  • Idaho (ID): Added id_us_govt_interest_subtraction test cases
  • Indiana (IN): Added in_us_govt_interest_deduction test cases
  • Kentucky (KY): Added ky_us_govt_interest_subtraction test cases
  • Louisiana (LA): Added la_us_govt_interest_exemption test cases
  • Michigan (MI): Added mi_us_govt_interest_subtraction test cases

All 10 states include YAML test cases validating the exemption logic.

Closes

Test plan

  1. Run existing test suite to verify no regressions: uv run pytest policyengine_us/tests/
  2. Verify state income tax calculations with various US government bond interest amounts for each of the 10 states
  3. Confirm that bond interest is properly subtracted/deducted from AGI or taxable income
  4. Test edge cases: zero bond interest, negative bond interest (not applicable), scenarios with other deductions/subtractions
  5. Run state-specific tests: uv run pytest policyengine_us/tests/states/{state_code}/tax/income/

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (55a0045) to head (4aabd51).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #7673      +/-   ##
===========================================
+ Coverage   97.82%   100.00%   +2.17%     
===========================================
  Files           3         2       -1     
  Lines          92        34      -58     
  Branches        2         0       -2     
===========================================
- Hits           90        34      -56     
+ Misses          1         0       -1     
+ Partials        1         0       -1     
Flag Coverage Δ
unittests 100.00% <100.00%> (+2.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MaxGhenis MaxGhenis requested a review from DTrim99 March 3, 2026 12:59
Add us_govt_interest as a subtraction/deduction for IA, ID, IL, IN, KS,
KY, LA, MA, MD, and MI. States IA, ID, IN, KY, LA, MI already had this
in their parameter files; IL, KS, MA, MD needed code changes. Includes
YAML test cases for all 10 states.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MaxGhenis MaxGhenis force-pushed the bond-interest-batch-2 branch from 422b7ef to 9eac56a Compare March 3, 2026 13:32
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment