Skip to content

Commit 05e8858

Browse files
Remove mv_file(): not in the specs, while mv() is (#1585)
1 parent 69f4fe8 commit 05e8858

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

fsspec/implementations/arrow.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ def mv(self, path1, path2, **kwargs):
139139
path2 = self._strip_protocol(path2).rstrip("/")
140140
self.fs.move(path1, path2)
141141

142-
mv_file = mv
143-
144142
@wrap_exceptions
145143
def rm_file(self, path):
146144
path = self._strip_protocol(path)

fsspec/implementations/dirfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ def makedirs(self, path, *args, **kwargs):
329329
def rmdir(self, path):
330330
return self.fs.rmdir(self._join(path))
331331

332-
def mv_file(self, path1, path2, **kwargs):
333-
return self.fs.mv_file(
332+
def mv(self, path1, path2, **kwargs):
333+
return self.fs.mv(
334334
self._join(path1),
335335
self._join(path2),
336336
**kwargs,

fsspec/implementations/local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def get_file(self, path1, path2, callback=None, **kwargs):
150150
def put_file(self, path1, path2, callback=None, **kwargs):
151151
return self.cp_file(path1, path2, **kwargs)
152152

153-
def mv_file(self, path1, path2, **kwargs):
153+
def mv(self, path1, path2, **kwargs):
154154
path1 = self._strip_protocol(path1, remove_trailing_slash=True)
155155
path2 = self._strip_protocol(path2, remove_trailing_slash=True)
156156
shutil.move(path1, path2)

fsspec/implementations/tests/test_dirfs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,10 @@ def test_rmdir(mocker, dirfs):
542542
dirfs.fs.rmdir.assert_called_once_with(f"{PATH}/dir")
543543

544544

545-
def test_mv_file(mocker, dirfs):
546-
dirfs.fs.mv_file = mocker.Mock()
547-
dirfs.mv_file("one", "two", **KWARGS)
548-
dirfs.fs.mv_file.assert_called_once_with(f"{PATH}/one", f"{PATH}/two", **KWARGS)
545+
def test_mv(mocker, dirfs):
546+
dirfs.fs.mv = mocker.Mock()
547+
dirfs.mv("one", "two", **KWARGS)
548+
dirfs.fs.mv.assert_called_once_with(f"{PATH}/one", f"{PATH}/two", **KWARGS)
549549

550550

551551
def test_touch(mocker, dirfs):

0 commit comments

Comments
 (0)