Skip to content

Commit 61eb906

Browse files
committed
fix(notebooks): repair JSON source format and harden notebooks
- Repair character-by-character cell source serialization in 01_llama (cell 6) and 02_langchain (cells 6, 18) — source must be a list of full lines, not single-char list elements - Delay COORDINODE_PORT int() parsing until the else-branch so a malformed port value does not crash startup when COORDINODE_ADDR is set - Replace two-step DELETE+DELETE with DETACH DELETE in 00_seed_data cleanup to avoid duplicate-edge errors from undirected MATCH -[r]-() - Cap explicit LIMIT to min(n, 20) in 03_langgraph query_facts instead of unconditionally replacing it, preserving LIMIT 1 and similar - Wrap create_text_index calls inside try-blocks with idx_created flag in three FTS integration tests so node cleanup always runs even when index creation fails
1 parent d75026e commit 61eb906

5 files changed

Lines changed: 247 additions & 3205 deletions

File tree

demo/notebooks/00_seed_data.ipynb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,20 @@
119119
"id": "a1b2c3d4-0000-0000-0000-000000000007",
120120
"metadata": {},
121121
"outputs": [],
122-
"source": "import uuid\n\nDEMO_TAG = os.environ.get(\"COORDINODE_DEMO_TAG\") or f\"seed_data_{uuid.uuid4().hex[:8]}\"\nprint(\"Using DEMO_TAG:\", DEMO_TAG)\n# Delete relationships first, then nodes — two-step ensures correct cleanup across\n# all CoordiNode versions (embedded and server).\nclient.cypher(\n \"MATCH (n {demo: true, demo_tag: $tag})-[r]-() DELETE r\",\n params={\"tag\": DEMO_TAG},\n)\nclient.cypher(\n \"MATCH (n {demo: true, demo_tag: $tag}) DELETE n\",\n params={\"tag\": DEMO_TAG},\n)\nprint(\"Previous demo data removed\")"
122+
"source": [
123+
"import uuid\n",
124+
"\n",
125+
"DEMO_TAG = os.environ.get(\"COORDINODE_DEMO_TAG\") or f\"seed_data_{uuid.uuid4().hex[:8]}\"\n",
126+
"print(\"Using DEMO_TAG:\", DEMO_TAG)\n",
127+
"# Remove prior demo nodes and any attached relationships in one step to avoid\n",
128+
"# duplicate relationship matches during cleanup (undirected MATCH -[r]-() returns\n",
129+
"# each edge twice — once per endpoint — causing duplicate-delete errors).\n",
130+
"client.cypher(\n",
131+
" \"MATCH (n {demo: true, demo_tag: $tag}) DETACH DELETE n\",\n",
132+
" params={\"tag\": DEMO_TAG},\n",
133+
")\n",
134+
"print(\"Previous demo data removed\")"
135+
]
123136
},
124137
{
125138
"cell_type": "markdown",
@@ -373,4 +386,4 @@
373386
},
374387
"nbformat": 4,
375388
"nbformat_minor": 5
376-
}
389+
}

0 commit comments

Comments
 (0)