From 112695e4da9fa32112be812a6fe5702f44bd7a78 Mon Sep 17 00:00:00 2001
From: Ted
Date: Sun, 18 Jun 2023 17:47:58 -0700
Subject: [PATCH] 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
---
langchain/document_loaders/googledrive.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/langchain/document_loaders/googledrive.py b/langchain/document_loaders/googledrive.py
index 5e21d401ed..56c4ae4535 100644
--- a/langchain/document_loaders/googledrive.py
+++ b/langchain/document_loaders/googledrive.py
@@ -228,7 +228,7 @@ class GoogleDriveLoader(BaseLoader, BaseModel):
_files = files
returns = []
- for file in files:
+ for file in _files:
if file["trashed"] and not self.load_trashed_files:
continue
elif file["mimeType"] == "application/vnd.google-apps.document":