Skip to content

Commit

Permalink
Google Drive Improvements (#3057)
Browse files Browse the repository at this point in the history
* Google Drive Improvements

* mypy

* should work!

* variable cleanup

* final fixes
  • Loading branch information
hagen-danswer authored Nov 7, 2024
1 parent 07a1b49 commit 2758ffd
Show file tree
Hide file tree
Showing 22 changed files with 802 additions and 525 deletions.
20 changes: 10 additions & 10 deletions backend/danswer/connectors/gmail/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,16 @@ def _fetch_threads(
fields=THREAD_LIST_FIELDS,
q=query,
):
full_thread = add_retries(
lambda: gmail_service.users()
.threads()
.get(
userId=user_email,
id=thread["id"],
fields=THREAD_FIELDS,
)
.execute()
)()
full_threads = execute_paginated_retrieval(
retrieval_function=gmail_service.users().threads().get,
list_key=None,
userId=user_email,
fields=THREAD_FIELDS,
id=thread["id"],
)
# full_threads is an iterator containing a single thread
# so we need to convert it to a list and grab the first element
full_thread = list(full_threads)[0]
doc = thread_to_document(full_thread)
if doc is None:
continue
Expand Down
Loading

0 comments on commit 2758ffd

Please sign in to comment.