add import audit trail, live indicator recompute, reportes endpoints; production hardening

This commit is contained in:
Roberto Treviño Cervantes
2026-10-30 11:19:30 -06:00
parent 168edb30f5
commit 2b2c290f58
74 changed files with 4095 additions and 1782 deletions
+3 -3
View File
@@ -26,19 +26,19 @@ class JsonConnector(FileConnector):
try:
data = json.loads(raw)
except Exception as exc:
raise ConnectorError(f"could not parse JSON: {exc}") from exc
raise ConnectorError(f"no se pudo leer el JSON: {exc}") from exc
if record_path:
try:
for key in record_path.split("."):
data = data[key]
except (KeyError, TypeError, IndexError) as exc:
raise ConnectorError(f"record_path {record_path!r} not found: {exc}") from exc
raise ConnectorError(f"no se encontró record_path {record_path!r}: {exc}") from exc
if isinstance(data, dict):
data = data.get("data", [data])
if not isinstance(data, list) or not all(isinstance(record, dict) for record in data):
raise ConnectorError("JSON source must resolve to a list of objects")
raise ConnectorError("el JSON debe dar una lista de objetos")
self._record_path = record_path
self._df = pd.DataFrame([_flatten(record) for record in data], dtype=object)