From 4290e825b16d0d25b759c26dc7f3b4b2f859b2a0 Mon Sep 17 00:00:00 2001 From: Norman Valerio Date: Sun, 11 Aug 2024 19:21:25 -0600 Subject: [PATCH] Fixing flake issues --- poetry.lock | 2 +- pyminio/main.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index 7be1705..9d721af 100644 --- a/poetry.lock +++ b/poetry.lock @@ -54,7 +54,7 @@ files = [ cffi = ">=1.0.1" [package.extras] -dev = ["cogapp", "pre-commit", "pytest", "wheel"] +dev = ["cogapp", "pre-commit", "pytest", "wheel", "requests"] tests = ["pytest"] [[package]] diff --git a/pyminio/main.py b/pyminio/main.py index 0b035b6..074c184 100644 --- a/pyminio/main.py +++ b/pyminio/main.py @@ -539,7 +539,7 @@ def get_last_object(self, path: str) -> Union[ObjectData, None]: return self.get(new_path) def get_presigned_get_object_url( - self, path: str, expires=timedelta(hours=PRESIGNED_EXPIRATION_TIME) + self, path: str, expires: timedelta = timedelta(hours=PRESIGNED_EXPIRATION_TIME) ) -> str: """Get presigned URL string to download the object in the given path with default expiry of two hours. @@ -555,7 +555,7 @@ def get_presigned_get_object_url( if match.is_file(): details = self.minio_obj.stat_object(match.bucket, match.relative_path) if not details.is_dir: - url = self.minio_obj.presigned_get_object( + url: str = self.minio_obj.presigned_get_object( match.bucket, match.relative_path, expires=expires ) return url @@ -578,7 +578,7 @@ def get_presigned_put_object_url( self, to_path: str, file_name: str, - expires=timedelta(hours=PRESIGNED_EXPIRATION_TIME), + expires: timedelta = timedelta(hours=PRESIGNED_EXPIRATION_TIME), ) -> str: """Get presigned URL string to upload the object in the given path with default expiry of two hours. @@ -591,7 +591,7 @@ def get_presigned_put_object_url( if match.is_dir(): match = Match(join(to_path, basename(file_name))) - url = self.minio_obj.presigned_put_object( + url: str = self.minio_obj.presigned_put_object( match.bucket, match.relative_path, expires=expires ) return url @@ -599,7 +599,7 @@ def get_presigned_put_object_url( raise ValueError("the given path does not corresponds to a directory.") def get_presigned_delete_object_url( - self, path: str, expires=timedelta(hours=PRESIGNED_EXPIRATION_TIME) + self, path: str, expires: timedelta = timedelta(hours=PRESIGNED_EXPIRATION_TIME) ) -> str: """Get presigned URL string to delete the object in the given path with default expiry of two hours. @@ -615,7 +615,7 @@ def get_presigned_delete_object_url( if match.is_file(): details = self.minio_obj.stat_object(match.bucket, match.relative_path) if not details.is_dir: - url = self.minio_obj.get_presigned_url( + url: str = self.minio_obj.get_presigned_url( "DELETE", match.bucket, match.relative_path, expires=expires ) return url