Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdfs: implement isdir and isfile #4460

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dvc/tree/hdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions tests/func/test_import_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down