From 251f012dbf9b5ad38baf2aa4004f43f74287c55a Mon Sep 17 00:00:00 2001 From: laughingman7743 Date: Mon, 6 May 2024 02:50:55 +0900 Subject: [PATCH] fixup --- pyathena/filesystem/s3.py | 1 + tests/pyathena/filesystem/test_s3.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyathena/filesystem/s3.py b/pyathena/filesystem/s3.py index fda51d23..7d087967 100644 --- a/pyathena/filesystem/s3.py +++ b/pyathena/filesystem/s3.py @@ -723,6 +723,7 @@ def get_file(self, rpath: str, lpath: str, callback=_DEFAULT_CALLBACK, outfile=N with open(lpath, "wb") as local: with self.open(rpath, "rb", **kwargs) as remote: + callback.set_size(remote.size) while data := remote.read(remote.blocksize): local.write(data) callback.relative_update(len(data)) diff --git a/tests/pyathena/filesystem/test_s3.py b/tests/pyathena/filesystem/test_s3.py index 7c93b924..84779f31 100644 --- a/tests/pyathena/filesystem/test_s3.py +++ b/tests/pyathena/filesystem/test_s3.py @@ -241,7 +241,7 @@ def test_info_dir(self, fs): info = fs.info(dir) ls_info = fs.ls(dir, detail=True)[0] - assert info == ls_info + assert info.to_dict() == ls_info.to_dict() assert info.name == fs._strip_protocol(dir) assert info.bucket == bucket assert info.key == key