Skip to content
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

Document Loaders: GoogleDriveLoader hidden option to load spread sheets #3637

Closed
adrianlzt opened this issue Apr 27, 2023 · 3 comments
Closed

Comments

@adrianlzt
Copy link

In the docs of the GoogleDriveLoader says Currently, only Google Docs are supported, but then, in the code, there is a function _load_sheet_from_id.

That function is only used for folder loading.

Accessing the private method of the class is it possible, and works perfectly, to load spread sheets:

from langchain.document_loaders import GoogleDriveLoader
spreadsheet_id = "122tuu4r-yYng8Lj7XXXUgb-basdbk"
loader = GoogleDriveLoader(file_ids=[spreadsheet_id])
docs = loader._load_sheet_from_id(spreadsheet_id)

Probably _load_documents_from_ids needs some refactor to work based on the mimeType, as _load_documents_from_folder does.

@IanRogers-101Ways
Copy link
Contributor

This seems to have been fixed in #4926 ?

@lumenintellects
Copy link

lumenintellects commented Oct 25, 2023

@IanRogers-101Ways Seems that file_types attribute is supported only when for folder loading, when loading a list of files by id, the following error occurs:

pydantic.error_wrappers.ValidationError: 1 validation error for GoogleDriveLoader
__root__
  file_types can only be given when folder_id is given, (not when document_ids or file_ids are given). (type=value_error)

Copy link

dosubot bot commented Jan 31, 2024

Hi, @adrianlzt

I'm helping the LangChain team manage their backlog and am marking this issue as stale.

It seems like there was a discrepancy between the documentation and the code for GoogleDriveLoader, specifically regarding the support for loading spreadsheets. There were discussions about refactoring the _load_documents_from_ids function and an error related to the file_types attribute when loading a list of files by id. The issue has been resolved in a pull request.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Jan 31, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants