Skip to content

Commit

Permalink
fix: turns off raising duplicated edges unit test as we have these in…
Browse files Browse the repository at this point in the history
… our current codegraph generation
  • Loading branch information
hajdul88 committed Dec 9, 2024
1 parent af55ac5 commit 3cbcfc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 3 additions & 3 deletions cognee/modules/retrieval/description_to_codepart_search.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import logging

from typing import Set
from typing import Set, List
from cognee.infrastructure.databases.graph import get_graph_engine
from cognee.infrastructure.databases.vector import get_vector_engine
from cognee.modules.graph.cognee_graph.CogneeGraph import CogneeGraph
Expand All @@ -10,7 +10,7 @@
from cognee.shared.utils import send_telemetry


async def code_description_to_code_part_search(query: str, user: User = None, top_k = 1) -> list:
async def code_description_to_code_part_search(query: str, user: User = None, top_k = 2) -> list:
if user is None:
user = await get_default_user()

Expand All @@ -26,7 +26,7 @@ async def code_description_to_code_part(
query: str,
user: User,
top_k: int
) -> Set[str]:
) -> List[str]:
"""
Maps a code description query to relevant code parts using a CodeGraph pipeline.
Expand Down
13 changes: 0 additions & 13 deletions cognee/tests/unit/modules/graph/cognee_graph_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@ def test_add_edge_success(setup_graph):
assert edge in node2.skeleton_edges


def test_add_duplicate_edge(setup_graph):
"""Test adding a duplicate edge raises an exception."""
graph = setup_graph
node1 = Node("node1")
node2 = Node("node2")
graph.add_node(node1)
graph.add_node(node2)
edge = Edge(node1, node2)
graph.add_edge(edge)
with pytest.raises(EntityAlreadyExistsError, match="Edge .* already exists in the graph."):
graph.add_edge(edge)


def test_get_node_success(setup_graph):
"""Test retrieving an existing node."""
graph = setup_graph
Expand Down

0 comments on commit 3cbcfc1

Please sign in to comment.