Skip to content

Commit

Permalink
v1.2.2: Fixed type annotations for backward compatibility with python…
Browse files Browse the repository at this point in the history
… 3.8 (#9)
  • Loading branch information
SiddhantSadangi authored Dec 9, 2023
1 parent b9c28ee commit cb1dd66
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/st_supabase_connection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from streamlit.connections import BaseConnection
from supabase import Client, create_client

__version__ = "1.2.1"
__version__ = "1.2.2"


class SupabaseConnection(BaseConnection[Client]):
Expand Down Expand Up @@ -138,8 +138,8 @@ def create_bucket(
name: Optional[str] = None,
public: Optional[bool] = False,
file_size_limit: Optional[int] = None,
allowed_mime_types: Optional[list[str]] = None,
) -> dict[str, str]:
allowed_mime_types: Optional["list[str]"] = None,
) -> "dict[str, str]":
"""Creates a new storage bucket.
Parameters
Expand Down Expand Up @@ -175,7 +175,7 @@ def upload(
file: Union[str, Path, BytesIO],
destination_path: str,
overwrite: Literal["true", "false"] = "false",
) -> dict[str, str]:
) -> "dict[str, str]":
"""Uploads a file to a Supabase bucket.
Parameters
Expand Down Expand Up @@ -263,8 +263,8 @@ def update_bucket(
bucket_id: str,
public: Optional[bool] = False,
file_size_limit: Optional[bool] = None,
allowed_mime_types: Optional[Union[str, list[str]]] = None,
) -> dict[str, str]:
allowed_mime_types: Optional[Union[str, "list[str]"]] = None,
) -> "dict[str, str]":
"""Update a storage bucket.
Parameters
Expand All @@ -288,7 +288,7 @@ def update_bucket(
response = self.client.storage._request("PUT", f"/bucket/{bucket_id}", json=json)
return response.json()

def move(self, bucket_id: str, from_path: str, to_path: str) -> dict[str, str]:
def move(self, bucket_id: str, from_path: str, to_path: str) -> "dict[str, str]":
"""Moves an existing file, optionally renaming it at the same time.
Parameters
Expand All @@ -311,7 +311,7 @@ def move(self, bucket_id: str, from_path: str, to_path: str) -> dict[str, str]:
)
return response.json()

def remove(self, bucket_id: str, paths: list) -> dict[str, str]:
def remove(self, bucket_id: str, paths: list) -> "dict[str, str]":
"""Deletes files within the same bucket
Parameters
Expand All @@ -337,7 +337,7 @@ def list_objects(
sortby: Optional[Literal["name", "updated_at", "created_at", "last_accessed_at"]] = "name",
order: Optional[Literal["asc", "desc"]] = "asc",
ttl: Optional[Union[float, timedelta, str]] = None,
) -> list[dict[str, str]]:
) -> "list[dict[str, str]]":
"""Lists all the objects within a bucket.
Parameters
Expand Down Expand Up @@ -374,9 +374,9 @@ def _list_objects(_self, bucket_id, path, limit, offset, sortby, order):
def create_signed_urls(
self,
bucket_id: str,
paths: list[str],
paths: "list[str]",
expires_in: int,
) -> list[dict[str, str]]:
) -> "list[dict[str, str]]":
"""Parameters
----------
bucket_id : str
Expand Down Expand Up @@ -424,7 +424,7 @@ def _get_public_url(_self, bucket_id, filepath):

return _get_public_url(self, bucket_id, filepath)

def create_signed_upload_url(self, bucket_id: str, path: str) -> dict[str, str]:
def create_signed_upload_url(self, bucket_id: str, path: str) -> "dict[str, str]":
"""Parameters
----------
bucket_id : str
Expand Down Expand Up @@ -459,7 +459,7 @@ def upload_to_signed_url(
path: str,
token: str,
file: Union[str, Path, BytesIO],
) -> dict[str, str]:
) -> "dict[str, str]":
"""Upload a file with a token generated from `.create_signed_url()`
Parameters
Expand Down

0 comments on commit cb1dd66

Please sign in to comment.