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

Remove mv_file(): not in the specs, while mv() is #1585

Merged
merged 1 commit into from
Apr 25, 2024
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
2 changes: 0 additions & 2 deletions fsspec/implementations/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ def mv(self, path1, path2, **kwargs):
path2 = self._strip_protocol(path2).rstrip("/")
self.fs.move(path1, path2)

mv_file = mv

@wrap_exceptions
def rm_file(self, path):
path = self._strip_protocol(path)
Expand Down
4 changes: 2 additions & 2 deletions fsspec/implementations/dirfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def makedirs(self, path, *args, **kwargs):
def rmdir(self, path):
return self.fs.rmdir(self._join(path))

def mv_file(self, path1, path2, **kwargs):
return self.fs.mv_file(
def mv(self, path1, path2, **kwargs):
return self.fs.mv(
self._join(path1),
self._join(path2),
**kwargs,
Expand Down
2 changes: 1 addition & 1 deletion fsspec/implementations/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_file(self, path1, path2, callback=None, **kwargs):
def put_file(self, path1, path2, callback=None, **kwargs):
return self.cp_file(path1, path2, **kwargs)

def mv_file(self, path1, path2, **kwargs):
def mv(self, path1, path2, **kwargs):
path1 = self._strip_protocol(path1, remove_trailing_slash=True)
path2 = self._strip_protocol(path2, remove_trailing_slash=True)
shutil.move(path1, path2)
Expand Down
8 changes: 4 additions & 4 deletions fsspec/implementations/tests/test_dirfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ def test_rmdir(mocker, dirfs):
dirfs.fs.rmdir.assert_called_once_with(f"{PATH}/dir")


def test_mv_file(mocker, dirfs):
dirfs.fs.mv_file = mocker.Mock()
dirfs.mv_file("one", "two", **KWARGS)
dirfs.fs.mv_file.assert_called_once_with(f"{PATH}/one", f"{PATH}/two", **KWARGS)
def test_mv(mocker, dirfs):
dirfs.fs.mv = mocker.Mock()
dirfs.mv("one", "two", **KWARGS)
dirfs.fs.mv.assert_called_once_with(f"{PATH}/one", f"{PATH}/two", **KWARGS)


def test_touch(mocker, dirfs):
Expand Down