yangdx
commited on
Commit
·
47d6008
1
Parent(s):
b20527f
Fix linting
Browse files
lightrag/kg/postgres_impl.py
CHANGED
@@ -1238,7 +1238,7 @@ class PGGraphStorage(BaseGraphStorage):
|
|
1238 |
self, source_node_id: str, target_node_id: str
|
1239 |
) -> dict[str, str] | None:
|
1240 |
"""Get edge properties between two nodes"""
|
1241 |
-
|
1242 |
src_label = source_node_id.strip('"')
|
1243 |
tgt_label = target_node_id.strip('"')
|
1244 |
|
@@ -1515,7 +1515,7 @@ class PGGraphStorage(BaseGraphStorage):
|
|
1515 |
if node_id not in nodes_dict:
|
1516 |
nodes_dict[node_id] = KnowledgeGraphNode(
|
1517 |
id=node_id,
|
1518 |
-
labels=[result["n"]["properties"]["entity_id"]],
|
1519 |
properties=result["n"]["properties"],
|
1520 |
)
|
1521 |
# Handle node list cases
|
@@ -1526,10 +1526,10 @@ class PGGraphStorage(BaseGraphStorage):
|
|
1526 |
if node_id not in nodes_dict and "properties" in node:
|
1527 |
nodes_dict[node_id] = KnowledgeGraphNode(
|
1528 |
id=node_id,
|
1529 |
-
labels=[node["properties"]["entity_id"]],
|
1530 |
properties=node["properties"],
|
1531 |
)
|
1532 |
-
|
1533 |
# Handle single edge cases
|
1534 |
if result.get("r") and isinstance(result["r"], dict):
|
1535 |
edge_id = str(result["r"]["id"])
|
|
|
1238 |
self, source_node_id: str, target_node_id: str
|
1239 |
) -> dict[str, str] | None:
|
1240 |
"""Get edge properties between two nodes"""
|
1241 |
+
|
1242 |
src_label = source_node_id.strip('"')
|
1243 |
tgt_label = target_node_id.strip('"')
|
1244 |
|
|
|
1515 |
if node_id not in nodes_dict:
|
1516 |
nodes_dict[node_id] = KnowledgeGraphNode(
|
1517 |
id=node_id,
|
1518 |
+
labels=[result["n"]["properties"]["entity_id"]],
|
1519 |
properties=result["n"]["properties"],
|
1520 |
)
|
1521 |
# Handle node list cases
|
|
|
1526 |
if node_id not in nodes_dict and "properties" in node:
|
1527 |
nodes_dict[node_id] = KnowledgeGraphNode(
|
1528 |
id=node_id,
|
1529 |
+
labels=[node["properties"]["entity_id"]],
|
1530 |
properties=node["properties"],
|
1531 |
)
|
1532 |
+
|
1533 |
# Handle single edge cases
|
1534 |
if result.get("r") and isinstance(result["r"], dict):
|
1535 |
edge_id = str(result["r"]["id"])
|