mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
community[patch]: improve test setup to accurately test filtering of labels in neo4j (#22531)
**Description:** This PR addresses an issue with an existing test that was not effectively testing the intended functionality. The previous test setup did not adequately validate the filtering of the labels in neo4j, because the nodes and relationship in the test data did not have any properties set. Without properties these labels would not have been returned, regardless of the filtering. --------- Co-authored-by: Oskar Hane <oh@oskarhane.com>
This commit is contained in:
parent
7fcef2556c
commit
3280a5b49b
@ -266,12 +266,17 @@ def test_neo4j_filtering_labels() -> None:
|
|||||||
# Remove all constraints
|
# Remove all constraints
|
||||||
graph.query("CALL apoc.schema.assert({}, {})")
|
graph.query("CALL apoc.schema.assert({}, {})")
|
||||||
graph.query(
|
graph.query(
|
||||||
"CREATE (:`_Bloom_Scene_`)-[:_Bloom_HAS_SCENE_]->(:`_Bloom_Perspective_`)"
|
"""
|
||||||
|
CREATE (:_Bloom_Scene_ {property_a: 'a'})
|
||||||
|
-[:_Bloom_HAS_SCENE_ {property_b: 'b'}]
|
||||||
|
->(:_Bloom_Perspective_)
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
graph.refresh_schema()
|
graph.refresh_schema()
|
||||||
|
|
||||||
# Assert both are empty
|
# Assert all are empty
|
||||||
assert graph.structured_schema["node_props"] == {}
|
assert graph.structured_schema["node_props"] == {}
|
||||||
|
assert graph.structured_schema["rel_props"] == {}
|
||||||
assert graph.structured_schema["relationships"] == []
|
assert graph.structured_schema["relationships"] == []
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user