Skip to content

Commit 86f5c4f

Browse files
committed
fix(tests,langchain,demo): use params keyword, assert schema_mode, pin demo image version
- langchain graph.py: pass params={} as keyword argument to cypher() - test_sdk.py: assert schema_mode is int in (0, 3) in flexible-mode test; document RETURN n → Value::Int(node_id) in FTS tests - demo/docker-compose.yml: pin coordinode:0.3.11 (was :latest)
1 parent d1966b6 commit 86f5c4f

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

demo/docker-compose.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
services:
2+
coordinode:
3+
image: ghcr.io/structured-world/coordinode:0.3.11
4+
container_name: demo-coordinode
5+
ports:
6+
- "37080:7080" # gRPC (native API)
7+
- "37084:7084" # Prometheus /metrics, /health
8+
volumes:
9+
- coordinode-data:/data
10+
environment:
11+
- COORDINODE_LOG_FORMAT=text
12+
restart: unless-stopped
13+
healthcheck:
14+
test: ["CMD", "/coordinode", "version"]
15+
interval: 5s
16+
timeout: 3s
17+
retries: 10
18+
start_period: 5s
19+
20+
jupyter:
21+
build:
22+
context: .
23+
dockerfile: Dockerfile.jupyter
24+
container_name: demo-jupyter
25+
ports:
26+
- "38888:8888" # Jupyter Lab
27+
volumes:
28+
- ./notebooks:/home/jovyan/work
29+
- ../:/sdk # mount SDK source so notebooks can pip install -e
30+
environment:
31+
- COORDINODE_ADDR=coordinode:7080 # internal network address
32+
- JUPYTER_ENABLE_LAB=yes
33+
- JUPYTER_TOKEN=demo
34+
- SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 # hatch-vcs: skip git, use fixed version
35+
depends_on:
36+
coordinode:
37+
condition: service_healthy
38+
restart: unless-stopped
39+
40+
volumes:
41+
coordinode-data:
42+
driver: local

langchain-coordinode/langchain_coordinode/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def refresh_schema(self) -> None:
154154
# published Docker image (tracked in G010 / GAPS.md).
155155
rows = self._client.cypher(
156156
"MATCH (a)-[r]->(b) RETURN DISTINCT labels(a) AS src_labels, type(r) AS rel, labels(b) AS dst_labels",
157-
{},
157+
params={},
158158
)
159159
if rows:
160160
triples: set[tuple[str, str, str]] = set()

tests/integration/test_sdk.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ def test_create_label_schema_mode_flexible(client):
489489
info = client.create_label(name, schema_mode="flexible")
490490
assert isinstance(info, LabelInfo)
491491
assert info.name == name
492+
assert isinstance(info.schema_mode, int)
493+
assert info.schema_mode in (0, 3) # 0 on older servers, 3 = FLEXIBLE
492494

493495

494496
def test_create_label_invalid_schema_mode_raises(client):
@@ -593,6 +595,8 @@ def test_text_search_returns_results(client):
593595
"""text_search() finds nodes whose text property matches the query."""
594596
label = f"FtsTest_{uid()}"
595597
tag = uid()
598+
# CoordiNode executor serialises a node variable as Value::Int(node_id) — runner.rs NodeScan
599+
# path. No id() function needed; rows[0]["node_id"] is the integer internal node id.
596600
rows = client.cypher(
597601
f"CREATE (n:{label} {{tag: $tag, body: 'machine learning and neural networks'}}) RETURN n AS node_id",
598602
params={"tag": tag},
@@ -648,6 +652,7 @@ def test_hybrid_text_vector_search_returns_results(client):
648652
label = f"FtsHybridTest_{uid()}"
649653
tag = uid()
650654
vec = [float(i) / 16 for i in range(16)]
655+
# Same node-as-int pattern: RETURN n → Value::Int(node_id) in CoordiNode executor.
651656
rows = client.cypher(
652657
f"CREATE (n:{label} {{tag: $tag, body: 'graph neural network embedding', embedding: $vec}}) RETURN n AS node_id",
653658
params={"tag": tag, "vec": vec},

0 commit comments

Comments
 (0)