11import re
2- from typing import Any , Dict , Union
2+ from typing import Any , Dict , Optional , Union
33
44from gotrue import SyncMemoryStorage
55from gotrue .types import AuthChangeEvent , Session
66from httpx import Timeout
7- from postgrest import SyncFilterRequestBuilder , SyncPostgrestClient , SyncRequestBuilder
7+ from postgrest import (
8+ SyncPostgrestClient ,
9+ SyncRequestBuilder ,
10+ SyncRPCFilterRequestBuilder ,
11+ )
812from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
913from storage3 import SyncStorageClient
1014from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
@@ -115,7 +119,9 @@ def from_(self, table_name: str) -> SyncRequestBuilder:
115119 """
116120 return self .postgrest .from_ (table_name )
117121
118- def rpc (self , fn : str , params : Dict [Any , Any ]) -> SyncFilterRequestBuilder :
122+ def rpc (
123+ self , fn : str , params : Optional [Dict [Any , Any ]] = None
124+ ) -> SyncRPCFilterRequestBuilder :
119125 """Performs a stored procedure call.
120126
121127 Parameters
@@ -131,6 +137,8 @@ def rpc(self, fn: str, params: Dict[Any, Any]) -> SyncFilterRequestBuilder:
131137 Returns a filter builder. This lets you apply filters on the response
132138 of an RPC.
133139 """
140+ if params is None :
141+ params = {}
134142 return self .postgrest .rpc (fn , params )
135143
136144 @property
0 commit comments