diff --git a/dvc/tree/hdfs.py b/dvc/tree/hdfs.py index be2f48a6e8..9ba6010be0 100644 --- a/dvc/tree/hdfs.py +++ b/dvc/tree/hdfs.py @@ -130,6 +130,14 @@ def copy(self, from_info, to_info, **_kwargs): self.remove(tmp_info) raise + def isfile(self, path_info): + with self.hdfs(path_info) as hdfs: + return hdfs.isfile(path_info.path) + + def isdir(self, path_info): + with self.hdfs(path_info) as hdfs: + return hdfs.isdir(path_info.path) + def hadoop_fs(self, cmd, user=None): cmd = "hadoop fs -" + cmd if user: diff --git a/tests/func/test_import_url.py b/tests/func/test_import_url.py index 27ad5ae8a5..2454d96eed 100644 --- a/tests/func/test_import_url.py +++ b/tests/func/test_import_url.py @@ -146,6 +146,7 @@ def test_import_url(tmp_dir, dvc, workspace): pytest.lazy_fixture("local_cloud"), pytest.lazy_fixture("s3"), pytest.lazy_fixture("gs"), + pytest.lazy_fixture("hdfs"), pytest.param( pytest.lazy_fixture("ssh"), marks=pytest.mark.skipif(