From dbf82137eb3c18b8892bf1853072f9e82dd0d57b Mon Sep 17 00:00:00 2001 From: anand2312 <40204976+anand2312@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:28:52 +0530 Subject: [PATCH 1/2] fix: make download key optional --- storage3/_async/file_api.py | 2 +- storage3/types.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage3/_async/file_api.py b/storage3/_async/file_api.py index de990a6f..6a9650ad 100644 --- a/storage3/_async/file_api.py +++ b/storage3/_async/file_api.py @@ -187,7 +187,7 @@ async def create_signed_urls( """ json = {"paths": paths, "expiresIn": str(expires_in)} if options.get("download"): - json.update({"download": options["download"]}) + json.update({"download": options.get("download")}) response = await self._request( "POST", diff --git a/storage3/types.py b/storage3/types.py index cd193fdf..9ae218f6 100644 --- a/storage3/types.py +++ b/storage3/types.py @@ -67,7 +67,7 @@ class URLOptions(TypedDict, total=False): transform: TransformOptions -class CreateSignedURLsOptions(TypedDict): +class CreateSignedURLsOptions(TypedDict, total=False): download: Union[str, bool] From fc936629932271b12bb741b87140744c83d2369b Mon Sep 17 00:00:00 2001 From: anand2312 <40204976+anand2312@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:36:34 +0530 Subject: [PATCH 2/2] chore: run unasync --- storage3/_sync/file_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage3/_sync/file_api.py b/storage3/_sync/file_api.py index fe6c9d66..d5faa917 100644 --- a/storage3/_sync/file_api.py +++ b/storage3/_sync/file_api.py @@ -187,7 +187,7 @@ def create_signed_urls( """ json = {"paths": paths, "expiresIn": str(expires_in)} if options.get("download"): - json.update({"download": options["download"]}) + json.update({"download": options.get("download")}) response = self._request( "POST",