fix(nspd-geo): json.dumps for quarter raw_props (Python True → JSON true)
_save_quarter использовал str(dict).replace("'", '"') как hack для GeoJSON
→ JSON. Это ломалось на Python booleans (True/False/None), которые в JSON
должны быть true/false/null. После dumps=False фикса rosreestr2coord
возвращает Python dict с булями в properties (is_actual=True) → INSERT
падал с psycopg.errors.InvalidTextRepresentation. _save_building уже
использовал json.dumps корректно.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ce5e29f92e
commit
1a0bf10017
1 changed files with 3 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ Resume:
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
|
|
@ -145,8 +146,8 @@ def _save_quarter(db: Session, payload: dict, cad_num: str) -> int:
|
|||
),
|
||||
{
|
||||
"cad": cad_num,
|
||||
"g": str(geom_geojson).replace("'", '"'),
|
||||
"props": str(f.get("properties", {})).replace("'", '"'),
|
||||
"g": json.dumps(geom_geojson, ensure_ascii=False),
|
||||
"props": json.dumps(f.get("properties") or {}, ensure_ascii=False),
|
||||
},
|
||||
)
|
||||
return 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue