From 5ec376aec5ec4d1260e70a5d7a3b63b22245b57a Mon Sep 17 00:00:00 2001 From: Trim21 Date: Wed, 30 Aug 2023 12:54:57 +0800 Subject: [PATCH] Update api.py --- minio/api.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/minio/api.py b/minio/api.py index 72364774a..b0043635c 100644 --- a/minio/api.py +++ b/minio/api.py @@ -21,7 +21,7 @@ Simple Storage Service (aka S3) client to perform bucket and object operations. """ -from __future__ import absolute_import +from __future__ import absolute_import, annotations import itertools import os @@ -1075,9 +1075,17 @@ def fget_object(self, bucket_name, object_name, file_path, response.close() response.release_conn() - def get_object(self, bucket_name, object_name, offset=0, length=0, - request_headers=None, ssec=None, version_id=None, - extra_query_params=None): + def get_object( + self, + bucket_name: str, + object_name: str, + offset: int = 0, + length: int = 0, + request_headers: dict[str, str] | None = None, + ssec: SseCustomerKey | None = None, + version_id: str | None = None, + extra_query_params: dict[str, str] | None = None + ) -> urllib3.BaseHTTPResponse: """ Get data of an object. Returned response should be closed after use to release network resources. To reuse the connection, it's required to