mypy fixed types

This commit is contained in:
brian
2024-10-19 20:03:54 +00:00
parent 6d327bee22
commit 14ccaace95
7 changed files with 18 additions and 17 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
"""Definition of put function."""
from __future__ import annotations
import logging
@@ -16,8 +17,8 @@ def put(
"""Put buffer in bucket in MinIO and return MD5 checksum as object name."""
assert isinstance(client, Minio)
assert isinstance(buffer, BytesIO)
bucket_name = os.getenv('MINIO_BUCKET_NAME', default=None)
assert isinstance(bucket_name, str)
bucket_name = os.getenv('MINIO_BUCKET_NAME', default='')
assert len(bucket_name) > 0
# get md5 of image
checksum = md5(buffer.getbuffer()).hexdigest()
# prepare for saving