From 1213f53fc9cceb7ef6a451f2a2fe067fd3405c41 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sun, 4 May 2025 02:20:43 +0800 Subject: [PATCH] Fix mistakenly interpreting a string as JSON for PostgreSQL AGE graph storage --- lightrag/kg/postgres_impl.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 026d3f6e..7dcd969b 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -1252,15 +1252,7 @@ class PGGraphStorage(BaseGraphStorage): elif dtype == "edge": d[k] = json.loads(v) else: - try: - d[k] = ( - json.loads(v) - if isinstance(v, str) - and (v.startswith("{") or v.startswith("[")) - else v - ) - except json.JSONDecodeError: - d[k] = v + d[k] = v # Keep as string return d