Fix climate_action_incentive_category enum crash#550
Merged
PavelMakarchuk merged 3 commits intoPolicyEngine:masterfrom Mar 18, 2026
Merged
Conversation
select() with no default returns 0 (int) when no condition matches, which fails enum encoding. This happens for children in two-parent households who don't match any of the four conditions. Add default=OTHER_CHILD so unmatched persons get a valid enum value. This unblocks household_net_income and marginal_tax_rate calculations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test category assignment for two-parent household with child (the crash case) - Test single-parent household eldest child gets special category - Test single person gets HEAD - Integration test for two-parent and married-couple households Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
select()inclimate_action_incentive_categoryreturns0(int) when no condition matches, which fails enum encodingdefault=ClimateActionIncentiveCategory.OTHER_CHILDso unmatched persons get a valid enum valuehousehold_net_incomeandmarginal_tax_ratewhich were completely brokenTest plan
household_net_incomenow works for single earners and families with childrenmarginal_tax_ratenow works🤖 Generated with Claude Code