fix: Improve the Google Drive / Sharepoint / OneDrive connector's validation and sync#421
Merged
Merged
Conversation
pushkala-datastax
approved these changes
Nov 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves the robustness and clarity of the Google Drive connector by adding better error handling, initialization checks, and more informative logging. The changes help prevent issues related to uninitialized services, stale shortcut data, and unclear authentication failures, making debugging and user experience smoother.
Error handling and initialization checks:
self.serviceis initialized before performing operations like listing children, downloading files, resolving shortcuts, and listing files. Raises clear runtime errors if not initialized. [1] [2] [3] [4]load_credentials, added handling for failed refresh token scenarios: clears credentials, removes invalid token file, and raises a clear error message prompting re-authentication.Shortcut cache management:
_clear_shortcut_cache()and ensured the shortcut cache is cleared at the start of_iter_selected_itemsto prevent stale shortcut resolution. [1] [2]Improved logging and error surfacing:
list_filesto log errors with stack traces and re-raise exceptions, surfacing authentication and permission issues instead of silently swallowing them.