Skip to content
Snippets Groups Projects
Unverified Commit 9c1d1db5 authored by Amir Mehr's avatar Amir Mehr Committed by GitHub
Browse files

Fix - Google Drive Issue of not loading same name files (#12022)

parent b8717bb0
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,3 @@ poetry_requirements( ...@@ -5,7 +5,3 @@ poetry_requirements(
"google-auth-oauthlib": ["google_auth_oauthlib"], "google-auth-oauthlib": ["google_auth_oauthlib"],
}, },
) )
python_requirements(
name="reqs",
)
...@@ -310,11 +310,12 @@ class GoogleDriveReader(BaseReader): ...@@ -310,11 +310,12 @@ class GoogleDriveReader(BaseReader):
metadata = {} metadata = {}
for fileid_meta in fileids_meta: for fileid_meta in fileids_meta:
filename = fileid_meta[2] # Download files and name them with their fileid
filepath = os.path.join(temp_dir, filename)
fileid = fileid_meta[0] fileid = fileid_meta[0]
filepath = os.path.join(temp_dir, fileid)
final_filepath = self._download_file(fileid, filepath) final_filepath = self._download_file(fileid, filepath)
# Add metadata of the file to metadata dictionary
metadata[final_filepath] = { metadata[final_filepath] = {
"file id": fileid_meta[0], "file id": fileid_meta[0],
"author": fileid_meta[1], "author": fileid_meta[1],
......
...@@ -45,7 +45,7 @@ maintainers = [ ...@@ -45,7 +45,7 @@ maintainers = [
] ]
name = "llama-index-readers-google" name = "llama-index-readers-google"
readme = "README.md" readme = "README.md"
version = "0.1.6" version = "0.1.7"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.10,<4.0" python = ">=3.10,<4.0"
......
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
PyDrive
gkeepapi
python_tests(
interpreter_constraints=["==3.10.*"],
)
from llama_index.core.readers.base import BaseReader
from llama_index.readers.google import GoogleDriveReader
def test_class():
names_of_base_classes = [b.__name__ for b in GoogleDriveReader.__mro__]
assert BaseReader.__name__ in names_of_base_classes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment