Merged
Conversation
- Add error handling for MinIO get_object and read operations, with validation and clear logging for bucket/object issues - Wrap pdfplumber.open and page.extract_text in try/except to handle corrupted or password-protected PDFs and log errors - Refactor table extraction: add per-row and per-cell sanitization, robustly handle non-iterable or malformed tables, and log all exceptions with context - Warn on large PDF files loaded into memory - Ensure all error cases are logged and do not break pipeline processing
…or improved readability and maintainability
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🔍 PR Validation Results
|
Germanadjemian
approved these changes
Dec 17, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the PDF processing pipeline to support table-aware chunking, preventing tables from being split across chunks. The refactoring extracts MinIO client logic into a separate module and introduces a content block abstraction that distinguishes between text and table content types.
Key Changes:
- Added
langchain-text-splittersdependency and removed duplicate dependencies in pyproject.toml - Extracted MinIO client configuration into a dedicated
minio_client.pymodule withget_minio_client()anddownload_object()utility functions - Refactored PDF processing to extract content as typed blocks (text vs. table), with tables converted to markdown format and preserved as atomic units during chunking
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| RAGManager/pyproject.toml | Added langchain-text-splitters dependency; removed duplicate typing-extensions and uvicorn entries |
| RAGManager/app/services/minio_client.py | New module containing extracted MinIO client creation and object download utilities with proper error handling |
| RAGManager/app/services/pdf_processor.py | Refactored to extract content as typed blocks (text/table); tables converted to markdown; context extraction for tables; simplified error handling |
| RAGManager/app/services/chunking_service.py | Updated to handle table-aware chunking; tables remain atomic regardless of size; added small chunk merging logic; replaced hardcoded values with configurable parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.