From 127a9c74b2dcf57c783e8f92b9292c49c165a814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Thu, 28 Apr 2022 15:44:50 +0545 Subject: [PATCH] fs.put_file: fix function signature for size --- dvc/fs/http.py | 5 ++++- dvc/fs/ssh.py | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dvc/fs/http.py b/dvc/fs/http.py index 7f22de11e..f17930e7c 100644 --- a/dvc/fs/http.py +++ b/dvc/fs/http.py @@ -144,10 +144,13 @@ class HTTPFileSystem(FileSystem): from_file: Union[AnyFSPath, IO], to_info: AnyFSPath, callback: FsspecCallback = DEFAULT_CALLBACK, + size: int = None, **kwargs, ) -> None: kwargs.setdefault("method", self.upload_method) - super().put_file(from_file, to_info, callback=callback, **kwargs) + super().put_file( + from_file, to_info, callback=callback, size=size, **kwargs + ) # pylint: disable=arguments-differ diff --git a/dvc/fs/ssh.py b/dvc/fs/ssh.py index 6b8ac4e26..97ac12271 100644 --- a/dvc/fs/ssh.py +++ b/dvc/fs/ssh.py @@ -127,7 +127,14 @@ class SSHFileSystem(FileSystem): super().upload_fobj(fobj, tmp_file, **kwargs) def put_file( - self, from_file, to_info, callback=DEFAULT_CALLBACK, **kwargs + self, + from_file, + to_info, + callback=DEFAULT_CALLBACK, + size=None, + **kwargs, ): with as_atomic(self, to_info) as tmp_file: - super().put_file(from_file, tmp_file, callback=callback, **kwargs) + super().put_file( + from_file, tmp_file, callback=callback, size=size, **kwargs + )