Update operate.py
This commit is contained in:
parent
f576a28e0d
commit
e7a7ff62b2
1 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ async def _handle_single_entity_extraction(
|
||||||
record_attributes: list[str],
|
record_attributes: list[str],
|
||||||
chunk_key: str,
|
chunk_key: str,
|
||||||
):
|
):
|
||||||
if record_attributes[0] != '"entity"' or len(record_attributes) < 4:
|
if len(record_attributes) < 4 or record_attributes[0] != '"entity"':
|
||||||
return None
|
return None
|
||||||
# add this record as a node in the G
|
# add this record as a node in the G
|
||||||
entity_name = clean_str(record_attributes[1].upper())
|
entity_name = clean_str(record_attributes[1].upper())
|
||||||
|
|
@ -97,7 +97,7 @@ async def _handle_single_relationship_extraction(
|
||||||
record_attributes: list[str],
|
record_attributes: list[str],
|
||||||
chunk_key: str,
|
chunk_key: str,
|
||||||
):
|
):
|
||||||
if record_attributes[0] != '"relationship"' or len(record_attributes) < 5:
|
if len(record_attributes) < 5 or record_attributes[0] != '"relationship"':
|
||||||
return None
|
return None
|
||||||
# add this record as edge
|
# add this record as edge
|
||||||
source = clean_str(record_attributes[1].upper())
|
source = clean_str(record_attributes[1].upper())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue