Skip to content

Commit 4100857

Browse files
committed
Fix CI
1 parent 19fd435 commit 4100857

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

tests/e2e/experimental/test_simplekgpipeline_e2e.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ async def test_pipeline_builder_happy_path_legacy_schema(
128128

129129
# check the content of the graph:
130130
# check lexical graph content
131-
records, _, _ = driver.execute_query(
132-
"MATCH (start:chunkNodeLabel) RETURN start"
133-
)
131+
records, _, _ = driver.execute_query("MATCH (start:chunkNodeLabel) RETURN start")
134132
assert len(records) == 1
135133

136134
# check entity -> chunk relationships
@@ -162,8 +160,8 @@ async def test_pipeline_builder_happy_path(
162160

163161
# Instantiate schema
164162
entities = ["Person"]
165-
relations = []
166-
potential_schema = []
163+
relations: list[str] = []
164+
potential_schema: list[tuple[str, str, str]] = []
167165
schema = {
168166
"node_types": entities,
169167
"relationship_types": relations,
@@ -181,7 +179,7 @@ async def test_pipeline_builder_happy_path(
181179
llm=llm,
182180
driver=driver,
183181
embedder=embedder,
184-
schema=schema,
182+
schema=schema, # type: ignore[arg-type]
185183
from_pdf=from_pdf,
186184
on_error=on_error,
187185
lexical_graph_config=lexical_graph_config,
@@ -192,9 +190,7 @@ async def test_pipeline_builder_happy_path(
192190

193191
# check the content of the graph:
194192
# check lexical graph content
195-
records, _, _ = driver.execute_query(
196-
"MATCH (start:chunkNodeLabel) RETURN start"
197-
)
193+
records, _, _ = driver.execute_query("MATCH (start:chunkNodeLabel) RETURN start")
198194
assert len(records) == 1
199195

200196
# check entity -> chunk relationships

tests/unit/experimental/components/test_graph_pruning.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ def test_graph_pruning_validate_node(
167167
assert result is None
168168

169169

170-
def test_graph_pruning_enforce_nodes_lexical_graph(lexical_graph_config: LexicalGraphConfig) -> None:
170+
def test_graph_pruning_enforce_nodes_lexical_graph(
171+
lexical_graph_config: LexicalGraphConfig,
172+
) -> None:
171173
pruner = GraphPruning()
172174
result = pruner._enforce_nodes(
173175
extracted_nodes=[
174176
Neo4jNode(id="1", label="Paragraph"),
175177
],
176-
schema=GraphSchema(additional_node_types=False),
178+
schema=GraphSchema(node_types=tuple(), additional_node_types=False),
177179
lexical_graph_config=lexical_graph_config,
178180
pruning_stats=PruningStats(),
179181
)

tests/unit/experimental/pipeline/test_kg_builder.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
import neo4j
1919
import pytest
2020
from neo4j_graphrag.embeddings import Embedder
21-
from neo4j_graphrag.experimental.components.schema import (
22-
NodeType,
23-
RelationshipType,
24-
)
2521
from neo4j_graphrag.experimental.components.types import LexicalGraphConfig
2622
from neo4j_graphrag.experimental.pipeline.exceptions import PipelineDefinitionError
2723
from neo4j_graphrag.experimental.pipeline.kg_builder import SimpleKGPipeline

tests/unit/test_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939

4040
def _query_return_value(*args: Any, **kwargs: Any) -> list[Any]:
41-
query = kwargs.get("query", args[1] if len(args) > 1 else None)
41+
query = kwargs.get("query", args[1] if len(args) > 1 else "")
4242
if NODE_PROPERTIES_QUERY in query:
4343
return [
4444
{

0 commit comments

Comments
 (0)