Guard remaining MD local tax variables against unknown counties - #9147
Merged
Conversation
md_applicable_local_tax_rate and md_flat_rate_county_tax carried the same unguarded flat_rate[county] indexing that #9116 fixed in md_withheld_income_tax: an MD household whose county resolves to County.UNKNOWN (the default when county_fips is unmapped or absent) raised ParameterNotFoundError for gov.local.md.flat_rate.UNKNOWN, crashing any computation of MD local income tax. Extend the same UNKNOWN fallback to the default MD county to both variables. Extends #9116; same crash class as #8975. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9147 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 2 +1
Lines 18 42 +24
=========================================
+ Hits 18 42 +24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends #9116 (issue #8975) — same crash class, remaining instances.
Problem
md_applicable_local_tax_rateandmd_flat_rate_county_taxcarry the identical unguarded pattern that #9116 fixed inmd_withheld_income_tax:An MD household whose
countyresolves toCounty.UNKNOWN(the default whencounty_fipsis unmapped/absent) raisesParameterNotFoundError: The parameter 'gov.local.md.flat_rate.UNKNOWN' was not found, crashing any computation of MD local income tax. The #8975 harness only hit the SALT-withholding chain, so these two siblings survived that report; verified pre-fix on this branch that the new UNKNOWN test case raises exactly that error.Fix
Extend the same guard used by #9116 to both variables:
No modeling-convention change: UNKNOWN falls back to the same default county the non-MD path already uses.
Tests
md_flat_rate_county_tax.yaml: Allegany baseline (3.03% × $30,000 = $909, hand-checked) + UNKNOWN case pinned equal to it (raisedParameterNotFoundErrorbefore the fix).md_applicable_local_tax_rate.yaml: Allegany baseline (0.0303) + UNKNOWN case pinned equal.gov/states/md/tax/income189/189.🤖 Generated with Claude Code