Merge pull request #1512 from danielaskdd/fix-json-postgres
Fix node names with JSON formatting were mistakenly interpreted as JSON objects for PostgreSQL AGE graph storage
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user