Skip to content

Commit f652baf

Browse files
MaxGhenisclaude
andcommitted
Remove income variable check from generate(), keep in upload validator
The generate() method only modifies household_weight — the income variables come from the input dataset and their key names vary between builds. Income validation belongs in the upload validator which uses Microsimulation to compute and verify employment_income > $5T. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 22076cb commit f652baf

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

policyengine_us_data/datasets/cps/enhanced_cps.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -224,23 +224,7 @@ def generate(self):
224224
f"{int(np.sum(w > 0))} non-zero"
225225
)
226226

227-
# Validate critical income variable exists in data.
228-
# The CPS stores employment_income_before_lsr (or the older
229-
# employment_income key); either must be present with data.
230-
income_key = None
231-
for k in ("employment_income_before_lsr", "employment_income"):
232-
if k in data and data[k]:
233-
income_key = k
234-
break
235-
if income_key is None:
236-
raise ValueError(
237-
"Neither employment_income_before_lsr nor "
238-
"employment_income found with data in dataset"
239-
)
240-
logging.info(
241-
f"Post-generation validation passed for EnhancedCPS "
242-
f"(income key: {income_key})"
243-
)
227+
logging.info("Post-generation weight validation passed")
244228

245229
self.save_dataset(data)
246230

0 commit comments

Comments
 (0)