Skip to content

Commit e7a7ff6

Browse files
committed
Update operate.py
1 parent f576a28 commit e7a7ff6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎lightrag/operate.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def _handle_single_entity_extraction(
7676
record_attributes: list[str],
7777
chunk_key: str,
7878
):
79-
if record_attributes[0] != '"entity"' or len(record_attributes) < 4:
79+
if len(record_attributes) < 4 or record_attributes[0] != '"entity"':
8080
return None
8181
# add this record as a node in the G
8282
entity_name = clean_str(record_attributes[1].upper())
@@ -97,7 +97,7 @@ async def _handle_single_relationship_extraction(
9797
record_attributes: list[str],
9898
chunk_key: str,
9999
):
100-
if record_attributes[0] != '"relationship"' or len(record_attributes) < 5:
100+
if len(record_attributes) < 5 or record_attributes[0] != '"relationship"':
101101
return None
102102
# add this record as edge
103103
source = clean_str(record_attributes[1].upper())

0 commit comments

Comments
 (0)