fix(objective parser): use_float=True in ijson + default=str in json.dumps (#321)
All checks were successful
Deploy / changes (push) Successful in 5s
Deploy / build-backend (push) Successful in 27s
Deploy / build-frontend (push) Has been skipped
Deploy / build-worker (push) Successful in 28s
Deploy / deploy (push) Successful in 39s

This commit is contained in:
lekss361 2026-05-17 19:11:25 +00:00
parent d1b721a3be
commit c80d79e2d4

View file

@ -206,7 +206,7 @@ def _row_to_corp_room_month(row: dict, group_name: str, raw_id: int | None) -> d
),
# Audit
"raw_id": raw_id,
"raw_props": json.dumps(row, ensure_ascii=False),
"raw_props": json.dumps(row, ensure_ascii=False, default=str),
}
@ -342,7 +342,7 @@ def _row_to_lot(row: dict, raw_id: int | None, snapshot_date: date) -> dict:
"encumbrance_start_date": _parse_iso_date(row.get("Дата начала обременения")),
"egrn_actual_date": _parse_iso_date(row.get("Дата актуальности данных из ЕГРН")),
"raw_id": raw_id,
"raw_props": json.dumps(row, ensure_ascii=False),
"raw_props": json.dumps(row, ensure_ascii=False, default=str),
"snapshot_date": snapshot_date,
}
@ -543,7 +543,7 @@ def parse_lots_pf_stream(
history_batch: list[dict] = []
batches_since_commit = 0
for row in ijson.items(stream, "result.item"):
for row in ijson.items(stream, "result.item", use_float=True):
if not isinstance(row, dict):
continue
params = _row_to_lot(row, raw_id, snapshot_date)
@ -712,7 +712,7 @@ def parse_lots_pf_stream(
db.execute(_LOTS_HISTORY_INSERT, history_batch)
batch = []
for row in ijson.items(stream, "result.item"):
for row in ijson.items(stream, "result.item", use_float=True):
if not isinstance(row, dict):
continue
params = _row_to_lot(row, raw_id, snapshot_date)