diff --git a/fsspec/implementations/arrow.py b/fsspec/implementations/arrow.py index e3dd17f85..f9fea70d2 100644 --- a/fsspec/implementations/arrow.py +++ b/fsspec/implementations/arrow.py @@ -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) diff --git a/fsspec/implementations/dirfs.py b/fsspec/implementations/dirfs.py index b1b3f6db7..1b311ab2a 100644 --- a/fsspec/implementations/dirfs.py +++ b/fsspec/implementations/dirfs.py @@ -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, diff --git a/fsspec/implementations/local.py b/fsspec/implementations/local.py index 9d2b335cf..7938a9147 100644 --- a/fsspec/implementations/local.py +++ b/fsspec/implementations/local.py @@ -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) diff --git a/fsspec/implementations/tests/test_dirfs.py b/fsspec/implementations/tests/test_dirfs.py index e42b9b696..645ce9a65 100644 --- a/fsspec/implementations/tests/test_dirfs.py +++ b/fsspec/implementations/tests/test_dirfs.py @@ -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):