mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-09 04:18:32 +02:00
Fix service accounts + shared drives (#490)
This commit is contained in:
parent
bfab9d1ee7
commit
0c6077ee7e
@ -75,6 +75,7 @@ def _run_drive_file_query(
|
||||
results = (
|
||||
service.files()
|
||||
.list(
|
||||
corpora="allDrives", # needed to search through shared drives
|
||||
pageSize=batch_size,
|
||||
supportsAllDrives=include_shared,
|
||||
includeItemsFromAllDrives=include_shared,
|
||||
@ -124,6 +125,7 @@ def _get_folder_id(
|
||||
else:
|
||||
query += f"mimeType='{DRIVE_FOLDER_TYPE}'"
|
||||
|
||||
# TODO: support specifying folder path in shared drive rather than just `My Drive`
|
||||
results = (
|
||||
service.files()
|
||||
.list(
|
||||
@ -248,7 +250,7 @@ def get_all_files_batched(
|
||||
),
|
||||
)
|
||||
|
||||
if traverse_subfolders:
|
||||
if traverse_subfolders and folder_id is not None:
|
||||
folder_ids_traversed = folder_ids_traversed or []
|
||||
subfolders = _get_folders(
|
||||
service=service,
|
||||
|
@ -203,9 +203,9 @@ const GoogleDriveConnectorManagement = ({
|
||||
})(values)}
|
||||
<BooleanFormField
|
||||
name="include_shared"
|
||||
label="Include Shared Files"
|
||||
label="Include Shared Files + Shared Drives"
|
||||
subtext={
|
||||
"If checked, then we will also index all documents shared with you. " +
|
||||
"If checked, then we will also index all documents + drives shared with you. " +
|
||||
"If this is combined with folder paths, then we will only index documents " +
|
||||
"that match both criteria."
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user