You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
extract_pdf_text silently returns "" when the optional pdf extra is missing — every PDF becomes an empty document #3702
detect.extract_pdf_text() wraps its whole body — including from pypdf import PdfReader — in except Exception: return "". pypdf is only installed behind the optional pdf extra, so an install of plain graphifyy turns every PDF in a corpus into an empty document: no error, no warning, no log line naming the missing dependency.
The only symptom reaches the user later, from the semantic pass:
[graphify] WARNING: 2/45 dispatched file(s) produced no nodes and are absent
from the graph: RFID_protocols.pdf, llrp_1_1-standard-20101013.pdf.
The model returned a response but omitted them; a re-run will retry them.
That reads as a model failure and sends you looking in the wrong place. "A re-run will retry them" is misleading too: every re-run fails identically, and a file that yields zero nodes gets no cache entry, so it is re-dispatched to the LLM forever.
Reproduce
uv tool install graphifyy (no extras)
Put any PDF with a text layer in the corpus
graphify extract . --backend claude-cli
The PDF is found (found N code, M docs, 2 papers) and dispatched, and contributes nothing.
Our case
graphify 0.9.65, Python 3.14.4, claude-cli backend. Two EPCglobal specifications of ~3 MB each, which yield 435,386 and 407,013 characters once pypdf is present. They contributed 46 nodes under 0.8.33 — which handed the file to the model directly — and zero after the move to local text extraction. It went unnoticed for months; we only found it because a node count dropped for an unrelated reason and we went reading the installed source.
uv tool install "graphifyy[pdf]" --with "pypdf[crypto]" fixes it completely.
Suggested fixes, in order of value
Let the ImportError surface, or catch it separately: PDF support requires the 'pdf' extra: uv tool install "graphifyy[pdf]". A missing dependency is not the same event as a malformed file, and except Exception conflates them.
The same for pypdf's DependencyError on AES-encrypted PDFs, which needs pypdf[crypto] and currently fails the same silent way.
When a dispatched file's text extraction comes back empty, say so before the LLM call, rather than reporting afterwards that the model omitted it.
Activity
fix(detect): warn when pypdf extra is missing in extract_pdf_text (Gr…