Skip to content

Commit

Permalink
SMB: Remove unexpected kwargs (coming from UPath.rename) (#1391)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Durant <[email protected]>
  • Loading branch information
martin-schulze-e2m and martindurant authored Oct 19, 2023
1 parent 3fbb6fe commit c20c31a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fsspec/implementations/smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _rm(self, path):
else:
smbclient.remove(wpath, port=self._port)

def mv(self, path1, path2, **kwargs):
def mv(self, path1, path2, recursive=None, maxdepth=None, **kwargs):
wpath1 = _as_unc_path(self.host, path1)
wpath2 = _as_unc_path(self.host, path2)
smbclient.rename(wpath1, wpath2, port=self._port, **kwargs)
Expand Down
6 changes: 6 additions & 0 deletions fsspec/implementations/tests/test_smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,9 @@ def test_makedirs_exist_ok(smb_params):
fsmb = fsspec.get_filesystem_class("smb")(**smb_params)
fsmb.makedirs("/home/a/b/c")
fsmb.makedirs("/home/a/b/c", exist_ok=True)


def test_rename_from_upath(smb_params):
fsmb = fsspec.get_filesystem_class("smb")(**smb_params)
fsmb.makedirs("/home/a/b/c", exist_ok=True)
fsmb.mv("/home/a/b/c", "/home/a/b/d", recursive=False, maxdepth=None)

0 comments on commit c20c31a

Please sign in to comment.