diff --git a/pyathena/filesystem/s3.py b/pyathena/filesystem/s3.py index 3d039832c..58ac57a02 100644 --- a/pyathena/filesystem/s3.py +++ b/pyathena/filesystem/s3.py @@ -1275,7 +1275,7 @@ def _copy_object_with_multipart_upload( block_size < self.MULTIPART_UPLOAD_MIN_PART_SIZE or block_size > self.MULTIPART_UPLOAD_MAX_PART_SIZE ): - raise ValueError("Block size must be greater than 5MiB and less than 5GiB.") + raise ValueError("Block size must be at least 5 MiB (5242880 bytes) and at most 5 GiB (5368709120 bytes).") copy_source = { "Bucket": bucket1, @@ -2322,7 +2322,7 @@ def __init__( if "r" not in mode and block_size < self.fs.MULTIPART_UPLOAD_MIN_PART_SIZE: # When writing occurs, the block size should not be smaller # than the minimum size of a part in a multipart upload. - raise ValueError(f"Block size must be >= {self.fs.MULTIPART_UPLOAD_MIN_PART_SIZE}MB.") + raise ValueError(f"Block size must be >= 5 MiB ({self.fs.MULTIPART_UPLOAD_MIN_PART_SIZE} bytes).") self.append_block = False if "a" in mode and self.fs.exists(path): diff --git a/pyathena/filesystem/s3_async.py b/pyathena/filesystem/s3_async.py index 77deccc2a..eb1f624c9 100644 --- a/pyathena/filesystem/s3_async.py +++ b/pyathena/filesystem/s3_async.py @@ -281,7 +281,7 @@ async def _copy_object_with_multipart_upload( block_size < S3FileSystem.MULTIPART_UPLOAD_MIN_PART_SIZE or block_size > S3FileSystem.MULTIPART_UPLOAD_MAX_PART_SIZE ): - raise ValueError("Block size must be greater than 5MiB and less than 5GiB.") + raise ValueError("Block size must be at least 5 MiB (5242880 bytes) and at most 5 GiB (5368709120 bytes).") copy_source: dict[str, Any] = { "Bucket": bucket1,