Fix data format convert problem for PostgreSQL graph storage
This commit is contained in:
parent
9c81963908
commit
11d7ef4a87
1 changed files with 8 additions and 5 deletions
|
|
@ -1100,11 +1100,14 @@ class PGGraphStorage(BaseGraphStorage):
|
|||
elif dtype == "edge":
|
||||
d[k] = json.loads(v)
|
||||
else:
|
||||
d[k] = (
|
||||
json.loads(v)
|
||||
if isinstance(v, str) and ("{" in v or "[" in v)
|
||||
else v
|
||||
)
|
||||
try:
|
||||
d[k] = (
|
||||
json.loads(v)
|
||||
if isinstance(v, str) and (v.startswith("{") or v.startswith("["))
|
||||
else v
|
||||
)
|
||||
except json.JSONDecodeError:
|
||||
d[k] = v
|
||||
|
||||
return d
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue