Salary sacrifice pension variable#214
Conversation
Comprehensive Review of PR #214: Salary Sacrifice Pension VariableI've completed a thorough validation of this PR. Overall, the implementation is structurally sound and follows established patterns, but there are some important considerations before merging. ✅ What's Working Well1. Companion PR Coordination
2. Implementation Quality
3. Supporting Files
|
| Check | Status | Notes |
|---|---|---|
| Variable exists in model | ✅ PASS | policyengine-uk PR #1372 |
| No hard-coded values | ✅ PASS | Uses constants appropriately |
| Pattern consistency | ✅ PASS | Matches employee_pension_contributions |
| Entity aggregation | ✅ PASS | Correct job → person mapping |
| Uprating factors | ✅ PASS | Properly configured |
| Changelog | ✅ PASS | Correct format |
| CI checks | ✅ PASS | All passing |
| Outlier handling | Consistent with job table pattern | |
| Test coverage | ❌ MISSING | No tests |
| Documentation | Has link, needs context | |
| Double-counting check | Needs confirmation |
Conclusion
This PR is nearly ready to merge. The implementation is clean and follows established patterns. The main concern is confirming that SPNAMT doesn't overlap with DEDUC1 to prevent double-counting.
Once you address the "Must Address" item (and ideally the "Should Address" items), this can be safely merged.
Great work on the implementation! 🎉
…ions - Add comprehensive smoke test for pension_contributions_via_salary_sacrifice - Validates non-negative values - Checks for presence of data - Ensures reasonableness against total employment income - Enhance inline documentation with detailed explanation: - What SPNAMT represents - Relationship to other pension variables - Rationale for not using outlier clipping (follows job table pattern) - Source attribution and data transformation notes Addresses review feedback on PR #214 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Updates AppliedI've proactively addressed the "Should Address" recommendations from my review: ✅ Changes Made
📊 CI StatusWaiting for CI to run on the new changes. The test should pass as it follows the same pattern as existing tests and uses the baseline fixture. 🔄 Still Needs ConfirmationThe key question from the original review remains:
This requires access to FRS data dictionary or confirmation from someone familiar with the FRS fields. Once that's confirmed, this PR should be ready to merge! 🚀 |
|
I can confirm that SPNAMT and DEDUC1 are distinct fields that measure different types of pension contributions:
|
What was added
1. New variable:
pension_contributions_via_salary_sacrificeLocation:
policyengine_uk_data/datasets/frs.py(lines 634-638)Source data: FRS job table, column
SPNAMT("Amount received for Salary Sacrifice Pension")Code:
What it does:
SPNAMTfrom FRSjob.tabfile2. Uprating factors
Files updated:
uprating_factors.csv(line 24)uprating_growth_factors.csv(line 24)