fix: skip non-string MIME metadata in DocumentTypeRouter - #12793
MohammadHijjawi97 wants to merge 1 commit into
Conversation
re.fullmatch requires a string. List or integer mime_type metadata raised TypeError.
|
@MohammadHijjawi97 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @MohammadHijjawi97, thanks for your interest in contributing to Haystack! 🙏 This is an automated message to help us keep the review queue healthy. |
|
Hi @MohammadHijjawi97, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
Thanks for signing the CLA, @MohammadHijjawi97! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
|
CLA is signed now. This is ready for review whenever you have time. |
b4c934d to
76c9dea
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
Related Issues
No existing issue. This PR includes a regression test for the crash.
Proposed Changes:
Proposed Changes:
DocumentTypeRouterpassedmime_typemetadata tore.fullmatch. A list or integer value raisedTypeError. Treat non-string MIME metadata as missing and route those documents tounclassified. Also guard invalidfile_pathvalues when guessing MIME type.How did you test it?
Added a unit test for list, integer, and
Nonemime metadata next to a valid string.Notes for the reviewer
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.