fix(objective parser): use_float=True in ijson + default=str in json.dumps #321
1 changed files with 4 additions and 4 deletions
|
|
@ -206,7 +206,7 @@ def _row_to_corp_room_month(row: dict, group_name: str, raw_id: int | None) -> d
|
||||||
),
|
),
|
||||||
# Audit
|
# Audit
|
||||||
"raw_id": raw_id,
|
"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("Дата начала обременения")),
|
"encumbrance_start_date": _parse_iso_date(row.get("Дата начала обременения")),
|
||||||
"egrn_actual_date": _parse_iso_date(row.get("Дата актуальности данных из ЕГРН")),
|
"egrn_actual_date": _parse_iso_date(row.get("Дата актуальности данных из ЕГРН")),
|
||||||
"raw_id": raw_id,
|
"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,
|
"snapshot_date": snapshot_date,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -543,7 +543,7 @@ def parse_lots_pf_stream(
|
||||||
history_batch: list[dict] = []
|
history_batch: list[dict] = []
|
||||||
batches_since_commit = 0
|
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):
|
if not isinstance(row, dict):
|
||||||
continue
|
continue
|
||||||
params = _row_to_lot(row, raw_id, snapshot_date)
|
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)
|
db.execute(_LOTS_HISTORY_INSERT, history_batch)
|
||||||
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):
|
if not isinstance(row, dict):
|
||||||
continue
|
continue
|
||||||
params = _row_to_lot(row, raw_id, snapshot_date)
|
params = _row_to_lot(row, raw_id, snapshot_date)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue