Summary
policyengine-core 3.24.0 (released 2026-04-17 17:39 UTC) breaks any Parameter.update(...) call whose parent chain includes a ParameterScale. Every policyengine-uk PR CI run kicked off after that release is failing with the same trace.
Stack trace
File "policyengine_uk/utils/parameters.py", line 19, in backdate_parameters
param.update(
period=periods.Period(("day", first_instant, num_days)),
value=earliest_value,
)
File "policyengine_core/parameters/parameter.py", line 210, in update
self.parent.clear_parent_cache()
File "policyengine_core/parameters/parameter_node.py", line 235, in clear_parent_cache
self.parent.clear_parent_cache()
AttributeError: 'ParameterScale' object has no attribute 'clear_parent_cache'
Reproduction
Any install on top of 3.24.0 that instantiates policyengine_uk.CountryTaxBenefitSystem and walks backdate_parameters over a tree that contains a ParameterScale will trip this.
policyengine-uk has ParameterScales under e.g. gov.hmrc.minimum_wage.non_apprentice (age-bracketed), so it's reproducible on current policyengine-uk main by installing 3.24.0 and running any test that touches the parameter tree.
Confirmed in CI
- policyengine-uk main's last passing "Code changes" run: 2026-04-17 13:22 UTC, resolved policyengine-core==3.23.6.
- Any PR CI run after 17:39 UTC picks up 3.24.0 and fails — seen today on:
The common trigger is just the PyPI resolution picking up 3.24.0. The PR code contents are incidental.
Likely cause
ParameterNode.clear_parent_cache recursively calls self.parent.clear_parent_cache(). If ParameterScale does not inherit from or define the method, the recursion blows up when a scale sits above an updated leaf. Either ParameterScale needs the method, or ParameterNode.clear_parent_cache should guard getattr(self.parent, "clear_parent_cache", None).
Requests
- Confirm the regression and ship a 3.24.1 patch.
- Consider adding
ParameterScale → clear_parent_cache to the PE-core test suite so this doesn't recur.
Meanwhile downstream can pin policyengine-core<3.24 as a stopgap.
Summary
policyengine-core3.24.0 (released 2026-04-17 17:39 UTC) breaks anyParameter.update(...)call whose parent chain includes aParameterScale. Every policyengine-uk PR CI run kicked off after that release is failing with the same trace.Stack trace
Reproduction
Any install on top of 3.24.0 that instantiates
policyengine_uk.CountryTaxBenefitSystemand walksbackdate_parametersover a tree that contains a ParameterScale will trip this.policyengine-uk has ParameterScales under e.g.
gov.hmrc.minimum_wage.non_apprentice(age-bracketed), so it's reproducible on currentpolicyengine-ukmain by installing 3.24.0 and running any test that touches the parameter tree.Confirmed in CI
support-py39branch (unrelated work)The common trigger is just the PyPI resolution picking up 3.24.0. The PR code contents are incidental.
Likely cause
ParameterNode.clear_parent_cacherecursively callsself.parent.clear_parent_cache(). IfParameterScaledoes not inherit from or define the method, the recursion blows up when a scale sits above an updated leaf. EitherParameterScaleneeds the method, orParameterNode.clear_parent_cacheshould guardgetattr(self.parent, "clear_parent_cache", None).Requests
ParameterScale→clear_parent_cacheto the PE-core test suite so this doesn't recur.Meanwhile downstream can pin
policyengine-core<3.24as a stopgap.