Skip to content

PyPDFDirectoryLoader always searches in subfolders, although recursive=False #24759

Closed Answered by dosubot bot
LarsKutz asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, @LarsKutz! I'm here to assist with any bugs or questions you have while we wait for a human maintainer. I can help you solve issues, answer questions, or even become a contributor. Let me know how I can assist you today!

No, it is not intended that the PyPDFDirectoryLoader always searches all subfolders for PDF files regardless of the recursive parameter. The code differentiates between recursive and non-recursive searches based on the value of the recursive parameter:

items = p.rglob(self.glob) if self.recursive else p.glob(self.glob)

If recursive is set to True, it uses p.rglob(self.glob) to search recursively. If recursive is set to False, it uses p.glob(self.glob) to search no…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LarsKutz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant