Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

Commit 8d711ef

Browse files
baogorekclaude
andcommitted
Fix legacy view test: create builder before installing legacy view
UnifiedMatrixBuilder.__init__ calls create_or_replace_views, which overwrites any previously installed view. The test was installing the legacy view first, then creating a builder that immediately replaced it with the current view (containing reform_id). Fix by creating the builder first, then installing the legacy view, and clearing the cached column metadata so the builder re-introspects the legacy schema. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 039109e commit 8d711ef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

policyengine_us_data/tests/test_calibration/test_unified_matrix_builder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ def test_inactive_targets_are_excluded(self):
275275
self.assertEqual(float(baseline_rows.iloc[0]["value"]), 10000.0)
276276

277277
def test_legacy_target_overview_without_reform_id(self):
278+
b = self._make_builder()
278279
_create_legacy_target_overview(self.engine)
279280
try:
280-
b = self._make_builder()
281+
b._target_overview_columns = None
281282
df = b._query_targets({"domain_variables": ["aca_ptc"]})
282283
self.assertGreater(len(df), 0)
283284
self.assertIn("reform_id", df.columns)

0 commit comments

Comments
 (0)