From c658ffd0b6e8ac9ca717eaab87e0c6830c3575eb Mon Sep 17 00:00:00 2001 From: Weves Date: Sun, 8 Oct 2023 00:05:16 -0700 Subject: [PATCH] Fix drive connector for service accounts with shared files turned off --- backend/danswer/connectors/google_drive/connector.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/danswer/connectors/google_drive/connector.py b/backend/danswer/connectors/google_drive/connector.py index 45fcdd756..24a2db5f1 100644 --- a/backend/danswer/connectors/google_drive/connector.py +++ b/backend/danswer/connectors/google_drive/connector.py @@ -75,7 +75,9 @@ def _run_drive_file_query( results = ( service.files() .list( - corpora="allDrives", # needed to search through shared drives + corpora="allDrives" + if include_shared + else "user", # needed to search through shared drives pageSize=batch_size, supportsAllDrives=include_shared, includeItemsFromAllDrives=include_shared,