Skip to content

Commit

Permalink
googledrive: skip empty files (#3173)
Browse files Browse the repository at this point in the history
* googledrive: skip empty file

* limitation
  • Loading branch information
spolu authored Jan 12, 2024
1 parent e9be09f commit 72813bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions connectors/src/connectors/google_drive/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,19 @@ async function syncOneFile(
return false;
}

if (!documentContent || documentContent.trim().length === 0) {
logger.info(
{
connectorId: connectorId,
documentId,
fileMimeType: file.mimeType,
fileId: file.id,
title: file.name,
},
"Skipping empty document"
);
}

const content = renderDocumentTitleAndContent({
title: file.name,
updatedAt: file.updatedAtMs ? new Date(file.updatedAtMs) : undefined,
Expand Down
2 changes: 1 addition & 1 deletion front/lib/connector_providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const CONNECTOR_CONFIGURATIONS: Record<
description:
"Authorize granular access to your company's Google Drive, by drives and folders. Supported files include GDocs, GSlides, and .txt files. Email us for .pdf indexation.",
limitations:
"Files with more than 750KB of extracted text are ignored. By default, PDF files are not indexed. Email us at [email protected] to enable PDF indexing.",
"Files with empty text content or with more than 750KB of extracted text are ignored. By default, PDF files are not indexed. Email us at [email protected] to enable PDF indexing.",
logoComponent: DriveLogo,
isNested: true,
},
Expand Down

0 comments on commit 72813bf

Please sign in to comment.