Daniel.y commited on
Commit
030c559
·
unverified ·
2 Parent(s): 0475253 e028351

Merge pull request #1512 from danielaskdd/fix-json-postgres

Browse files

Fix node names with JSON formatting were mistakenly interpreted as JSON objects for PostgreSQL AGE graph storage

Files changed (1) hide show
  1. lightrag/kg/postgres_impl.py +1 -9
lightrag/kg/postgres_impl.py CHANGED
@@ -1252,15 +1252,7 @@ class PGGraphStorage(BaseGraphStorage):
1252
  elif dtype == "edge":
1253
  d[k] = json.loads(v)
1254
  else:
1255
- try:
1256
- d[k] = (
1257
- json.loads(v)
1258
- if isinstance(v, str)
1259
- and (v.startswith("{") or v.startswith("["))
1260
- else v
1261
- )
1262
- except json.JSONDecodeError:
1263
- d[k] = v
1264
 
1265
  return d
1266
 
 
1252
  elif dtype == "edge":
1253
  d[k] = json.loads(v)
1254
  else:
1255
+ d[k] = v # Keep as string
 
 
 
 
 
 
 
 
1256
 
1257
  return d
1258