@@ -34,7 +34,7 @@ def __init__(
34
34
self ,
35
35
supabase_url : str ,
36
36
supabase_key : str ,
37
- options : Union [ClientOptions , None ] = None ,
37
+ options : Optional [ClientOptions ] = None ,
38
38
):
39
39
"""Instantiate the client.
40
40
@@ -97,7 +97,7 @@ async def create(
97
97
cls ,
98
98
supabase_url : str ,
99
99
supabase_key : str ,
100
- options : Union [ClientOptions , None ] = None ,
100
+ options : Optional [ClientOptions ] = None ,
101
101
):
102
102
auth_header = options .headers .get ("Authorization" ) if options else None
103
103
client = cls (supabase_url , supabase_key , options )
@@ -278,9 +278,7 @@ def _init_postgrest_client(
278
278
def _create_auth_header (self , token : str ):
279
279
return f"Bearer { token } "
280
280
281
- def _get_auth_headers (
282
- self , authorization : Union [str , None ] = None
283
- ) -> Dict [str , str ]:
281
+ def _get_auth_headers (self , authorization : Optional [str ] = None ) -> Dict [str , str ]:
284
282
if authorization is None :
285
283
authorization = self .options .headers .get (
286
284
"Authorization" , self ._create_auth_header (self .supabase_key )
@@ -293,7 +291,7 @@ def _get_auth_headers(
293
291
}
294
292
295
293
def _listen_to_auth_events (
296
- self , event : AuthChangeEvent , session : Union [Session , None ]
294
+ self , event : AuthChangeEvent , session : Optional [Session ]
297
295
):
298
296
access_token = self .supabase_key
299
297
if event in ["SIGNED_IN" , "TOKEN_REFRESHED" , "SIGNED_OUT" ]:
@@ -310,7 +308,7 @@ def _listen_to_auth_events(
310
308
async def create_client (
311
309
supabase_url : str ,
312
310
supabase_key : str ,
313
- options : Union [ClientOptions , None ] = None ,
311
+ options : Optional [ClientOptions ] = None ,
314
312
) -> AsyncClient :
315
313
"""Create client function to instantiate supabase client like JS runtime.
316
314
0 commit comments