Skip to content

Commit 65a2daf

Browse files
lijicodecaocuilongCaralHsi
authored
Dev ccl1103 (#449)
* fix:parse_node * fix: * fix:conn * fix:getnode * fix: --------- Co-authored-by: ccl <[email protected]> Co-authored-by: CaralHsi <[email protected]>
1 parent a0f3a00 commit 65a2daf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/memos/graph_dbs/polardb.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,9 @@ def get_node(
859859

860860
if result:
861861
if include_embedding:
862-
properties_json, embedding_json = result
862+
_, properties_json, embedding_json = result
863863
else:
864-
properties_json = result
864+
_, properties_json = result
865865
embedding_json = None
866866

867867
# Parse properties from JSONB if it's a string
@@ -889,8 +889,8 @@ def get_node(
889889
return self._parse_node(
890890
{
891891
"id": id,
892-
"memory": json.loads(properties[1]).get("memory", ""),
893-
**json.loads(properties[1]),
892+
"memory": properties.get("memory", ""),
893+
**properties,
894894
}
895895
)
896896
return None
@@ -1290,6 +1290,8 @@ def get_subgraph(
12901290

12911291
user_name = user_name if user_name else self._get_config_value("user_name")
12921292

1293+
if center_id.startswith('"') and center_id.endswith('"'):
1294+
center_id = center_id[1:-1]
12931295
# Use a simplified query to get the subgraph (temporarily only direct neighbors)
12941296
"""
12951297
SELECT * FROM cypher('{self.db_name}_graph', $$

0 commit comments

Comments
 (0)