get edges by uuids return empty list instead of errors (#308)
* get edges by uuids return empty list instead of errors * lint * fix null bugs * guard rails for null summary * supress
This commit is contained in:
parent
f91570a359
commit
f536c4e948
2 changed files with 7 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ from pydantic import BaseModel, Field
|
|||
from typing_extensions import LiteralString
|
||||
|
||||
from graphiti_core.embedder import EmbedderClient
|
||||
from graphiti_core.errors import EdgeNotFoundError, EdgesNotFoundError, GroupsEdgesNotFoundError
|
||||
from graphiti_core.errors import EdgeNotFoundError, GroupsEdgesNotFoundError
|
||||
from graphiti_core.helpers import DEFAULT_DATABASE, parse_db_date
|
||||
from graphiti_core.models.edges.edge_db_queries import (
|
||||
COMMUNITY_EDGE_SAVE,
|
||||
|
|
@ -289,8 +289,6 @@ class EntityEdge(Edge):
|
|||
|
||||
edges = [get_entity_edge_from_record(record) for record in records]
|
||||
|
||||
if len(edges) == 0:
|
||||
raise EdgesNotFoundError(uuids)
|
||||
return edges
|
||||
|
||||
@classmethod
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
"""
|
||||
|
||||
import logging
|
||||
from contextlib import suppress
|
||||
from time import time
|
||||
|
||||
import pydantic
|
||||
|
|
@ -365,9 +366,13 @@ async def resolve_extracted_node(
|
|||
|
||||
extracted_node.summary = node_attributes_response.get('summary', '')
|
||||
node_attributes = {
|
||||
key: value if value != 'None' else None for key, value in node_attributes_response.items()
|
||||
key: value if (value != 'None' or key == 'summary') else None
|
||||
for key, value in node_attributes_response.items()
|
||||
}
|
||||
|
||||
with suppress(KeyError):
|
||||
del node_attributes['summary']
|
||||
|
||||
extracted_node.attributes.update(node_attributes)
|
||||
|
||||
is_duplicate: bool = llm_response.get('is_duplicate', False)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue