diff --git a/4-Infrastructure/lib/jsonl.py b/4-Infrastructure/lib/jsonl.py index 025361b3..614e2b2e 100644 --- a/4-Infrastructure/lib/jsonl.py +++ b/4-Infrastructure/lib/jsonl.py @@ -42,4 +42,4 @@ def canonical_json(obj: Any) -> str: def canonical_json_bytes(obj: Any) -> bytes: """Deterministic JSON as bytes — suitable for hashing.""" - return stable_json(obj).encode("utf-8") + return canonical_json(obj).encode("utf-8") diff --git a/4-Infrastructure/shim/dataset_ingest_rds.py b/4-Infrastructure/shim/dataset_ingest_rds.py index afc71d49..6adaa67d 100644 --- a/4-Infrastructure/shim/dataset_ingest_rds.py +++ b/4-Infrastructure/shim/dataset_ingest_rds.py @@ -30,7 +30,13 @@ import psycopg2.extras from rds_connect import connect_rds sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) -from lib.jsonl import load_json as load_jsonl +from lib.jsonl import load_json + + +def load_jsonl(path: Path) -> list: + """Load a JSON file; return its contents if a list, else [].""" + data = load_json(path) + return data if isinstance(data, list) else [] logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")