From 770db1fdc4c948673bd6ea36e74bf33f93ea1d09 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Sat, 9 Apr 2022 10:29:37 +0200 Subject: [PATCH] hdfs: Fix `_strip_protocol` and `_checksum` Match behavior previous to #6946 --- dvc/fs/hdfs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dvc/fs/hdfs.py b/dvc/fs/hdfs.py index e77fdf9dd5..ffc5d98a37 100644 --- a/dvc/fs/hdfs.py +++ b/dvc/fs/hdfs.py @@ -23,7 +23,7 @@ class HDFSFileSystem(CallbackMixin, FSSpecWrapper): def _strip_protocol(cls, path: str) -> str: from fsspec.utils import infer_storage_options - return infer_storage_options(path)["path"].lstrip("/") + return infer_storage_options(path)["path"] def unstrip_protocol(self, path: str) -> str: host = self.fs_args["host"] @@ -60,7 +60,7 @@ def _checksum(self, path, **kwargs): result = self._run_command( f"checksum {url}", env=fix_env(os.environ), - user=self.fs_args["user"], + user=self.fs_args.get("user"), ) if result is None: return None