gdrive: fix path operations

This commit is contained in:
Ruslan Kuprieiev
2021-12-02 18:52:18 +02:00
committed by GitHub
parent 8dd3b28729
commit 024f06d672
+5 -3
View File
@@ -93,10 +93,12 @@ class GDriveFileSystem(FSSpecWrapper): # pylint:disable=abstract-method
def _strip_protocol(cls, path):
from fsspec.utils import infer_storage_options
return infer_storage_options(path)["path"].lstrip("/")
opts = infer_storage_options(path)
return "{host}{path}".format(**opts)
def unstrip_protocol(self, path):
return f"gdrive://{self._bucket}/{path}"
return f"gdrive://{path}"
@staticmethod
def _get_kwargs_from_urls(urlpath):
@@ -247,7 +249,7 @@ class GDriveFileSystem(FSSpecWrapper): # pylint:disable=abstract-method
os.remove(temporary_save_path)
return _GDriveFileSystem(
self.url,
f"{self._bucket}/{self._path}",
gauth,
trash_only=self._trash_only,
)