generated from coulomb/repo-seed
feat: bootstrap accountability-root fabric snapshot
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -67,8 +68,7 @@ def financial_export_from_legacy(
|
||||
],
|
||||
"unresolved": [],
|
||||
}
|
||||
if legacy_graph.get("generated_at"):
|
||||
graph["generated_at"] = legacy_graph["generated_at"]
|
||||
graph["generated_at"] = legacy_graph.get("generated_at") or _utc_now()
|
||||
materialized = materialize_financial_graph_export(graph)
|
||||
errors = financial_graph_errors(materialized)
|
||||
if errors:
|
||||
@@ -135,3 +135,7 @@ def _has_value(value: Any) -> bool:
|
||||
if isinstance(value, list):
|
||||
return any(_has_value(item) for item in value)
|
||||
return value not in (None, "")
|
||||
|
||||
|
||||
def _utc_now() -> str:
|
||||
return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
||||
|
||||
Reference in New Issue
Block a user