Skip to content

Commit

Permalink
Fixing flake issues
Browse files Browse the repository at this point in the history
  • Loading branch information
novama committed Aug 12, 2024
1 parent 40f27fb commit 4290e82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pyminio/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -591,15 +591,15 @@ 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

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.
Expand All @@ -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
Expand Down

0 comments on commit 4290e82

Please sign in to comment.