mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Iterate through filtered file types instead of all listed files (#6258)
# Iterate through filtered file types instead of all listed files Fixes https://github.com/hwchase17/langchain/issues/6257 https://github.com/hwchase17/langchain/pull/4926 originally added the functionality to filter by file type, storing the filtered files in `_files` https://github.com/hwchase17/langchain/pull/5220 removed the functionality when adding code to filter trashed files by using the `files` variables instead of the `_files` variable. This PR simply adds the functionality back by using `_files` again. #### Who can review? @hwchase17 - project lead @eyurtsev
This commit is contained in:
parent
ba90e3c990
commit
112695e4da
@ -228,7 +228,7 @@ class GoogleDriveLoader(BaseLoader, BaseModel):
|
|||||||
_files = files
|
_files = files
|
||||||
|
|
||||||
returns = []
|
returns = []
|
||||||
for file in files:
|
for file in _files:
|
||||||
if file["trashed"] and not self.load_trashed_files:
|
if file["trashed"] and not self.load_trashed_files:
|
||||||
continue
|
continue
|
||||||
elif file["mimeType"] == "application/vnd.google-apps.document":
|
elif file["mimeType"] == "application/vnd.google-apps.document":
|
||||||
|
Loading…
Reference in New Issue
Block a user