Skip to content

Commit 54be235

Browse files
authored
Merge pull request #251 from American-Institutes-for-Research/HEA-968/GT06_Other_Cash_Income_KeyError_income
Add regex that removes extra whitespaces within the lablel see HEA-968
2 parents 17cfd2d + 0d96dde commit 54be235

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pipelines/assets/livelihood_activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def get_livelihood_activity_label_map(activity_type: str) -> dict[str, dict]:
332332
Return a dict of the attributes for the Livelihood Activities, stored in the ActivityLabel Django model.
333333
"""
334334
label_map = {
335-
instance["activity_label"].lower(): instance
335+
re.sub(r"\s+", " ", instance["activity_label"].strip().lower()): instance
336336
for instance in ActivityLabel.objects.filter(
337337
status=ActivityLabel.LabelStatus.OVERRIDE, activity_type=activity_type
338338
).values(

0 commit comments

Comments
 (0)