-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat]: add authorization identities to GoogleDriveLoader. #110
Conversation
load_auth: bool = False | ||
"""Whether to load authorization identities.""" | ||
|
||
def _get_identity_metadata_from_id(self, id: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits: can you add a typehint here, please (if I understand correctly, it should be -> List[str]
?
authorized_identities = [] | ||
creds = self._load_credentials() | ||
service = build("drive", "v3", credentials=creds) # Build the service | ||
permissions = service.permissions().list(fileId=id).execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if a user has only view permissions and they don't have a permissions to retrieve permissions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lkuligin
With current code in place, if a user is missing with permissions to retrieve permissions for a particular file, it will print a error message on stdout and move on for the next file.
1284a0a
to
44f106a
Compare
@rahul-trip thanks for your contribution! please, fix the remaining linting errors. |
Hi @lkuligin |
@rahul-trip take a look at the Makefile, you can actually run these commands locally to save your time (if you install test dependencies) |
89b8fe8
to
6c897fa
Compare
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
6c897fa
to
d6d0375
Compare
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
d6d0375
to
a18b8b4
Compare
Hi @lkuligin |
congrats, and thanks for your contribution! |
…gleDriveLoader. (#20065) Description: Document update. GoogleDriveLoader: Added documentation for `load_auth` a new argument in document_loaders/GoogleDriveLoader. Dependencies: None Documentation: https://python.langchain.com/docs/integrations/document_loaders/google_drive/ Associated PR: langchain-ai/langchain-google#110 Twitter handle: @rahul_tripathi2 Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com> Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
…gleDriveLoader. (#20065) Description: Document update. GoogleDriveLoader: Added documentation for `load_auth` a new argument in document_loaders/GoogleDriveLoader. Dependencies: None Documentation: https://python.langchain.com/docs/integrations/document_loaders/google_drive/ Associated PR: langchain-ai/langchain-google#110 Twitter handle: @rahul_tripathi2 Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com> Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Description: Add Google Drive document access identities to metadata
Dependencies: none
Documentation: GoogleDrive documentation update with
load_auth
usage to be updated with PR: langchain-ai/langchain#20065