-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community[minor]: add exclude parameter to DirectoryLoader #17316
community[minor]: add exclude parameter to DirectoryLoader #17316
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
libs/community/langchain_community/document_loaders/directory.py
Outdated
Show resolved
Hide resolved
@@ -51,6 +52,7 @@ def __init__( | |||
path: Path to directory. | |||
glob: Glob pattern to use to find files. Defaults to "**/[!.]*" | |||
(all files except hidden). | |||
exclude: patterns to exclude from results, use glob syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide an example of how to exclude something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eyurtsev this is a direct copy from the docstring in the file system loader:
langchain/libs/community/langchain_community/document_loaders/blob_loaders/file_system.py
Line 68 in e10030e
exclude: patterns to exclude from results, use glob syntax |
Should I update all occurrences to keep them consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some docstring examples based on other loaders.
Thanks for the quick review @eyurtsev! Just noticed the tests also need some optional deps in CI, will rework this ASAP. |
167616c
to
6f524c4
Compare
7011967
to
143d007
Compare
Can merge if tests pass |
143d007
to
bd784e5
Compare
Going to help resolve conflicts so we can merge |
Can merge when tests pass |
Sorry got the wrong lockfile updated there, I was going to get back to the dependency issue but I see you already got around that by mocking it out @eyurtsev, I guess next time this should be green ;) |
@nejch awesome! thank you. We need to investigate what's going with the extra dependency, but didn't want that to block from getting your contribution merged in! |
Perfect, thanks a lot @eyurtsev. Looks like it's green now 👍 |
…-ai#17316) - **Description:** adds an `exclude` parameter to the DirectoryLoader class, based on similar behavior in GenericLoader - **Issue:** discussed in langchain-ai#9059 and I think in some other issues that I cannot find at the moment 🙇 - **Dependencies:** None - **Twitter handle:** don't have one sorry! Just https://github/nejch --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
exclude
parameter to the DirectoryLoader class, based on similar behavior in GenericLoader