Repository navigation
fix: walk pdfplumber pages lazily during extraction - #7346
Conversation
|
Hi maintainers, the CI annotation says the full pytest suite is required before merging and asks for the |
|
@AbarnaaSree please check the precommit |
|
Thanks for this — the core change is right and I verified it end-to-end: routing a crafted 20,000-page PDF through the real 1. The change breaks two existing tests (the red full-suite run). 2. Pre-commit is red on the changed files. 3. The central bounds documentation this change falsifies needs its update. 4. Nothing in the test changes actually pins the new behavior. Optional: a Verified along the way: touched suites 168/168 on the branch and on main (no test in the repo discriminates this change today — in the wrong direction); merge is conflict-free against current main; walker contract and per-page/stream close ordering read correct on all break paths. Sibling PRs: 4448, 5769, 6986 share the two large test files (file-overlap only; no competing lazy-walk change — none affects merge order here). Decision: CHANGES REQUESTED AI-assisted review. |
|
I've addressed the review feedback and pushed the updates in commit
Tests: 233 passed, 1 skipped. Please take another look when you have a chance. Thank you for the review and feedback! |
|
Hi maintainers, the latest |
|
@AbarnaaSree pre-commit |
|
Follow-up verified at What was verified
Optional
The Sibling PRs: none shares this fix target — #4448 (resumable research waves), #5769 (file-write containment) and #6986 (release decision binding) also touch Decision: APPROVED — OPTIONAL CHANGES AI-assisted review. |
Final reviewVerdict: ready to merge.
Optional:
|
|
Extracted follow-up from the review (now that the code is on main):
|
Summary
pdf.pagesiteration with the existing lazyiter_pdfplumber_pageshelper in the download service.Testing
test_pdf_extraction_bounds.py: 102 passed, 1 skipped.git diff --check: passed.Two tests in the broader combined run failed because they expected Unix-style paths (
/tmp/...) on Windows, where the service returnedD:\tmp\.... These were path-format assertion failures; the unmodified baseline was not tested.Scope and limitations
This change avoids eager page materialization in the pdfplumber extraction path. The original reported peak-memory issue has not yet been reproduced and measured end-to-end. The PyPDF fallback still iterates over
reader.pagesand may warrant separate investigation.