Skip to content

Commit

Permalink
gdrive: fix path operations
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop authored Dec 2, 2021
1 parent 8dd3b28 commit 024f06d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dvc/fs/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ def __init__(self, **config):
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):
Expand Down Expand Up @@ -247,7 +249,7 @@ def fs(self):
os.remove(temporary_save_path)

return _GDriveFileSystem(
self.url,
f"{self._bucket}/{self._path}",
gauth,
trash_only=self._trash_only,
)
Expand Down

0 comments on commit 024f06d

Please sign in to comment.