From 024f06d672a07a06a6b021c9d5ec6c7ed4390d4c Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 2 Dec 2021 18:52:18 +0200 Subject: [PATCH] gdrive: fix path operations --- dvc/fs/gdrive.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dvc/fs/gdrive.py b/dvc/fs/gdrive.py index f7fd6d705..3198ad028 100644 --- a/dvc/fs/gdrive.py +++ b/dvc/fs/gdrive.py @@ -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, )