Compare commits
1 commit
claude/fix
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3d4b11f48 |
2 changed files with 11 additions and 21 deletions
6
.github/workflows/docling-compat.yml
vendored
6
.github/workflows/docling-compat.yml
vendored
|
|
@ -27,7 +27,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: document-parser/requirements.txt
|
cache-dependency-path: document-parser/requirements-test.txt
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends poppler-utils
|
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends poppler-utils
|
||||||
|
|
@ -35,8 +35,8 @@ jobs:
|
||||||
- name: Install pinned dependencies
|
- name: Install pinned dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements-test.txt
|
||||||
pip install pytest pytest-asyncio httpx
|
pip install httpx
|
||||||
|
|
||||||
- name: Upgrade docling to latest
|
- name: Upgrade docling to latest
|
||||||
id: versions
|
id: versions
|
||||||
|
|
|
||||||
|
|
@ -238,14 +238,6 @@ async function renderGraph(): Promise<void> {
|
||||||
)
|
)
|
||||||
parentMap.value = computedParentMap
|
parentMap.value = computedParentMap
|
||||||
|
|
||||||
// Guard against dangling edges (source/target not in the node set). Both
|
|
||||||
// backends can emit them in edge cases — e.g. ON_PAGE edges whose page_no
|
|
||||||
// doesn't match any returned Page node, or DERIVED_FROM edges crossing
|
|
||||||
// document boundaries in Neo4j. Cytoscape-dagre auto-creates a skeleton
|
|
||||||
// graphlib entry for the missing endpoint with undefined data, then crashes
|
|
||||||
// in its ordering phase when it tries to set `.order` on that entry.
|
|
||||||
const nodeIds = new Set(payload.value.nodes.map((n) => n.id))
|
|
||||||
|
|
||||||
const elements = [
|
const elements = [
|
||||||
...payload.value.nodes.map((n) => ({
|
...payload.value.nodes.map((n) => ({
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -264,16 +256,14 @@ async function renderGraph(): Promise<void> {
|
||||||
raw: n,
|
raw: n,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
...payload.value.edges
|
...payload.value.edges.map((e) => ({
|
||||||
.filter((e) => nodeIds.has(e.source) && nodeIds.has(e.target))
|
data: {
|
||||||
.map((e) => ({
|
id: e.id,
|
||||||
data: {
|
source: e.source,
|
||||||
id: e.id,
|
target: e.target,
|
||||||
source: e.source,
|
type: e.type,
|
||||||
target: e.target,
|
},
|
||||||
type: e.type,
|
})),
|
||||||
},
|
|
||||||
})),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
cy.value = cytoscape({
|
cy.value = cytoscape({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue