Repository navigation
Conversation
…aves out policyengine-core gives every person a group in each collection: one group of everyone when a collection is omitted or null, and a group of their own when a present collection's groups leave them out. The v1-to-v2 translation requires an explicit membership instead and rejects these households, so their copies to v2 fail with failure_category "translation". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… gives them translate_legacy_household now creates the groups policyengine-core creates when it builds a simulation from a v1 household: one group of everyone for an omitted or null collection, and a group of their own for each person a present collection's groups leave out. The groups have stable ids after the named groups, no source_name and no values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4165 +/- ##
==========================================
- Coverage 88.22% 88.20% -0.02%
==========================================
Files 285 286 +1
Lines 16843 16886 +43
Branches 2741 2755 +14
==========================================
+ Hits 14859 14895 +36
- Misses 1302 1304 +2
- Partials 682 687 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ects A household of people alone now translates, because policyengine-core gives them one group of everyone in each omitted collection. The test that keeps a failed copy pending now uses a top-level key that is not an entity collection, which policyengine-core and the translation both reject. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
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.
Fixes #4164
Summary
<collection>-<n>, numbered in person-name order), nosource_nameand novalues. Named groups translate exactly as before.Two of the four production events in #4164 have this shape. With this change, their stored households translate, and each translated collection has the same number of groups as the policyengine-core simulation built from the v1 household. The other two events are households that policyengine-core rejects, and they still fail translation.
Commits
Reproduce v1 household copies rejected …: the new tests alone. They fail on master with the error production logged,people record memberships must identify every country-supported entity collection(andlegacy households must be an objectfor a null collection).Give people a v1 household leaves out …: the fix and the changelog fragment.Fail the integration test's household copy …:tests/integration/test_v1_household_dual_write.py::test_translation_failure_retains_one_pending_event_until_explicit_replayused a household of people alone as its translation failure. policyengine-core calculates that household, so it now copies. The test now uses a top-level key that is not an entity collection, which policyengine-core and the translation both reject.Testing
Ran only the new tests, by node ID:
tests/unit/v2/test_household_translation.py::test_omitted_collection_becomes_one_unnamed_group_of_everyone(US with three collections omitted, US with a nullhouseholdsand every other collection omitted, UK withbenunitsomitted)tests/unit/v2/test_household_translation.py::test_person_left_out_of_a_collection_gets_an_unnamed_group_of_their_ownAll failed on the first commit and pass on the second. The modified integration test needs the disposable databases that CI provides, so it ran only in CI; locally, its new household fails translation with
legacy household contains unsupported collections.ruff format,ruff checkandmypypass for the changed files. The rest of the suite runs in CI.After merge
Once this is deployed to production, each of the two affected events is copied by dispatching
process-v1-household-mirror-event.ymlfor its ID, one run at a time.🤖 Generated with Claude Code