You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Give migration directions for the removed gov.dwp.carer_premium.couple parameter (generalise add_removed_parameter_aliases) #2137
#2001 (merged as 3518331, released in 2.117.0) removed gov.dwp.carer_premium.couple. It held the single rate, and the law pays gov.dwp.carer_premium.single once for each qualifying claimant or partner. A saved policy or reform that still sets couple now fails with a bare lookup error:
ValueError: Could not find the parameter gov.dwp.carer_premium.couple (failed at couple).
Main already has a mechanism that fails with migration directions instead, REMOVED_PARAMETERS in policyengine_uk/utils/parameters.py. It is used for gov.dwp.state_pension.age.male and .female. But add_removed_parameter_aliases installs every alias under parameters.gov.dwp.state_pension.age. Adding the key gov.dwp.carer_premium.couple to the dict would therefore create gov.dwp.state_pension.age.couple and leave the carer premium path unchanged.
Proposed fix
In add_removed_parameter_aliases, resolve each removed path's parent node from the path itself, instead of using the fixed State Pension age node.
Then add "gov.dwp.carer_premium.couple" to REMOVED_PARAMETERS, with directions like: "The carer premium is now paid per qualifying claimant or partner; change gov.dwp.carer_premium.single (the per-person amount)."
Test that Reform.from_dict({"gov.dwp.carer_premium.couple": ...}) and a scenario naming the path both raise the new message. Also test that no alias appears under gov.dwp.state_pension.age.
Found by the independent review of #2001 after its merge with main (finding 5). It is not a correctness issue, because the reform already fails loudly.
Activity