Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes the test_cypher_save_load test from the GraphCypherQAChain integration tests #16

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions libs/neo4j/tests/integration_tests/chains/test_graph_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import os
from unittest.mock import MagicMock

import pytest
from langchain.chains.loading import load_chain
from langchain_core.language_models import BaseLanguageModel
from langchain_core.outputs import Generation, LLMResult

Expand Down Expand Up @@ -222,37 +220,6 @@ def test_cypher_return_direct() -> None:
assert output == expected_output


@pytest.mark.skip(reason="load_chain is failing and is due to be deprecated")
def test_cypher_save_load() -> None:
"""Test saving and loading."""

FILE_PATH = "cypher.yaml"
url = os.environ.get("NEO4J_URI")
username = os.environ.get("NEO4J_USERNAME")
password = os.environ.get("NEO4J_PASSWORD")
assert url is not None
assert username is not None
assert password is not None

graph = Neo4jGraph(
url=url,
username=username,
password=password,
)
llm = MagicMock(spec=BaseLanguageModel)
chain = GraphCypherQAChain.from_llm(
llm=llm,
graph=graph,
return_direct=True,
allow_dangerous_requests=True,
)

chain.save(file_path=FILE_PATH)
qa_loaded = load_chain(FILE_PATH, graph=graph)

assert qa_loaded == chain


def test_exclude_types() -> None:
"""Test exclude types from schema."""
url = os.environ.get("NEO4J_URI", "bolt://localhost:7687")
Expand Down