Repository navigation
fix(rag): assign PDF parser tables to tbls in book chunking method (#19557) - #19559
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PDF branch of the ChangesBook PDF table preservation
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change restores standalone PDF table and figure chunk preservation without introducing a merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit found tables tucked out of sight Comment |
|
Nice catch! LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #19559 +/- ##
==========================================
+ Coverage 29.92% 37.33% +7.41%
==========================================
Files 54 54
Lines 15383 15383
Branches 125 125
==========================================
+ Hits 4603 5743 +1140
+ Misses 10767 9613 -1154
- Partials 13 27 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary of Changes
Fixes #19557
In
rag/app/book.py, the PDF parsing branch receives(sections, tables, pdf_parser)fromparser(...), but previously omitted assigningtablestotbls. As a result,tblsremained[]andtokenize_table(tbls, ...)silently dropped all figure, table, and formula chunks for PDF documents using thebookchunking method.Changes Made:
tbls = tablesfollowing the PDF parser invocation inrag/app/book.py.tokenize_table(tbls, ...)properly emits table and image chunks for PDF inputs with DeepDOC and other layout parsers.Verification:
bookchunk method and verified non-zerodoc_type_kwdin{"table", "image"}chunks are preserved.