-
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
postgrest-py/postgrest/_async/client.py
Lines 15 to 21 in 576a5b8
from ..version import __version__ | |
from .request_builder import AsyncRequestBuilder, AsyncRPCFilterRequestBuilder | |
_TableT = Dict[str, Any] | |
class AsyncPostgrestClient(BasePostgrestClient): |
_TableT
should be (Edit: MutableMapping[str, Any]
Mapping[str, Any]
) instead of dict[str, Any]
to allow for users to specify a TypedDict as the output type. This seems to be a new-ish regression because my type checker wasn't complaining 4 months ago (edit: this is because there was no _TableT
in postgrest 0.19.3 )
Issues from the two main type checkers explaining why dict
is not compatible with TypedDict
by design
mypy: python/mypy#4976
pyright: microsoft/pyright#6658
To Reproduce
async def f():
db = AsyncClient(supabase_url, supabase_key, options)
response: APIResponse[MessageRecord] = await db.table("messages").select("*").execute()
class MessageRecord(TypedDict):
content: str | None
Expected behavior
Using a TypedDict should be accepted
System information
- OS: Windows
- postgrest-py: 1.0.1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working