Skip to content

Commit

Permalink
i
Browse files Browse the repository at this point in the history
  • Loading branch information
tlocke committed Oct 14, 2024
1 parent ce71802 commit 8352efe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions chellow/e/hh_parser_edf_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ def _find_data(shredder):
if value_str == "-":
break

status_str = values[val_idx + 50]
status_idx = val_idx + 50
status_str = values[status_idx]
try:
status = STATUS_LOOKUP[status_str]
except KeyError:
raise BadRequest(
f"Unrecognized status {status_str} at index {status_idx}."
)
yield {
"mpan_core": mpan_core,
"channel_type": channel_type,
"start_date": to_utc(start_day_ct + HH * i),
"value": Decimal(value_str),
"status": STATUS_LOOKUP[status_str],
"status": status,
}
except BadRequest as e:
e.description = (
Expand Down

0 comments on commit 8352efe

Please sign in to comment.