Bug/190-bug-pypdfium2-버전-업그레이드에-따른-함수-교체#192
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA small API alignment and dependency update: the PyPdfium backend now calls ChangesPyPdfium Image Bounds API Update
Dependency Bump
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docling/backend/pypdfium2_backend.py`:
- Line 259: The code uses pypdfium2's get_bounds() (replacing get_pos()), which
only exists in v5+, so update the pypdfium2 version constraint to require v5 or
newer by changing the constraint string ">=4.30.0, !=4.30.1, <6.0.0" to
">=5.0.0, <6.0.0" in the project dependency declaration; this ensures
installations cannot pull a v4.x pypdfium2 that would raise AttributeError for
get_bounds(), and no other code changes are needed because
BoundingBox.from_tuple(pos, origin=CoordOrigin.BOTTOMLEFT) remains compatible.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4a330f5d-25f0-43cd-b280-5bad9925fb90
📒 Files selected for processing (1)
docling/backend/pypdfium2_backend.py
There was a problem hiding this comment.
Code Review
This pull request updates the docling backend to use get_bounds() instead of get_pos() when retrieving image object positions in the pypdfium2 backend, which likely improves the accuracy of bounding box calculations. I have no feedback to provide as there were no review comments to evaluate.
54cccce to
9555fa5
Compare
📌 Summary
pypdfium2라이브러리 버전 업그레이드(4.30.0 → 5.6.0)로 인해 발생한 에러를 수정.get_pos()메소드가 v5.x에서 삭제됨에 따라, 이를 최신 API인get_bounds()로 교체.⚙️ 주요 변경 사항
PdfPageObject.get_pos()호출부를get_bounds()로 수정.docling백엔드에서 PDF 객체의 좌표를 정상적으로 가져오지 못해 발생하던AttributeError를 해결함.🛠 코드 변경 내역 (Diff)
Summary by CodeRabbit