Repository navigation
feat: add DOCX document loader - #78
Conversation
adaumsilva
left a comment
There was a problem hiding this comment.
Thanks for adding DOCX support! Please address these before merging:
- Restore the existing chunker imports and
__all__entries inragframework.document; removing them breaks public imports. - Install the
docxextra in CI for the new tests and add coverage for the missing-dependency error. - Restore the
0.2.0changelog heading. - Fix the Ruff failures and rerun CI; all three Python jobs currently stop before running tests.
Both DOCX loading modes worked in my local checks.
|
@deepakjanapa thanks for contributing. I requestes a few changes before merging the PR. Please address these changes. |
|
Hi @adaumsilva, I’ve addressed all the requested changes:
The latest CI workflow is currently showing “Action required” / awaiting maintainer approval, so I believe it just needs approval before the CI jobs can run. Thanks! |
adaumsilva
left a comment
There was a problem hiding this comment.
Thanks for adding DOCX support. All 13 loader tests pass locally with python-docx installed, and Ruff passes.
One issue needs fixing: mypy fails when python-docx is installed because DocxDocument is imported as a function and then assigned None in the ImportError handler.
Please:
- Move the guarded import inside DocxLoader.load(), preserving the helpful LoaderError when the dependency is unavailable, or use a correctly typed optional callable.
- Add the docx extra to the type-check CI installation (
".[faiss,docx]"). Currently that job does not install python-docx, so it misses this error. - Rerun mypy and the loader tests after the change.
Please also resolve the CHANGELOG.md conflict while preserving existing entries. I’ll handle the final changelog organization after the pending PRs are merged.
Once these changes are pushed and checks pass, please request another review.
|
Hi @adaumsilva, I’ve pushed the requested fixes in
The DOCX loader tests (13/13), Ruff, and mypy for the loader pass locally. The GitHub Actions workflow is currently awaiting maintainer approval before the required checks can run. Once the checks are approved and pass, I’ll request another review. |
adaumsilva
left a comment
There was a problem hiding this comment.
Thanks for addressing the requested changes! The guarded import, public exports, and CI dependencies look good.
All 13 loader tests pass locally, Ruff and mypy for the loader pass, and all GitHub checks are green. No blocking issues remain.
Approved. I’ll handle the final changelog cleanup, including restoring the existing README roadmap entry. Thanks for contributing DOCX support!
|
Good job @deepakjanapa! PR Merged! Remember to star the repo if you didn't yet. |
Description
Adds a
DocxLoaderfor loading DOCX documents into the RAG framework, with support for both per-paragraph and whole-file loading modes.Closes #2
Changes
DocxLoaderusing the optionalpython-docxdependencyLoaderErrorhandling for missing and invalid DOCX filesDocxLoaderfromragframework.documentCHANGELOG.mdunder[Unreleased]Type of change
Checklist
pytest tests/ -vpasses locallyruff check ragframework/passesmypy ragframework/passesCHANGELOG.mdupdated under[Unreleased]