Skip to content

Commit af83f15

Browse files
committed
fix: update with correct httpx client class
1 parent 64a9c4c commit af83f15

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

supabase/_async/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from gotrue import AsyncMemoryStorage
66
from gotrue.types import AuthChangeEvent, Session
7-
from httpx import AsyncClient, Timeout
7+
from httpx import Timeout
88
from postgrest import (
99
AsyncPostgrestClient,
1010
)
@@ -16,6 +16,7 @@
1616
from supafunc import AsyncFunctionsClient
1717

1818
from ..lib.client_options import AsyncClientOptions as ClientOptions
19+
from ..lib.client_options import AsyncHttpxClient
1920
from .auth_client import AsyncSupabaseAuthClient
2021

2122

@@ -266,7 +267,7 @@ def _init_postgrest_client(
266267
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
267268
verify: bool = True,
268269
proxy: Optional[str] = None,
269-
client: Union[AsyncClient, None] = None,
270+
client: Union[AsyncHttpxClient, None] = None,
270271
) -> AsyncPostgrestClient:
271272
"""Private helper for creating an instance of the Postgrest client."""
272273
return AsyncPostgrestClient(

supabase/_sync/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from gotrue import SyncMemoryStorage
55
from gotrue.types import AuthChangeEvent, Session
6-
from httpx import SyncClient, Timeout
6+
from httpx import Timeout
77
from postgrest import (
88
SyncPostgrestClient,
99
)
@@ -15,6 +15,7 @@
1515
from supafunc import SyncFunctionsClient
1616

1717
from ..lib.client_options import SyncClientOptions as ClientOptions
18+
from ..lib.client_options import SyncHttpxClient
1819
from .auth_client import SyncSupabaseAuthClient
1920

2021

@@ -265,7 +266,7 @@ def _init_postgrest_client(
265266
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
266267
verify: bool = True,
267268
proxy: Optional[str] = None,
268-
client: Union[SyncClient, None] = None,
269+
client: Union[SyncHttpxClient, None] = None,
269270
) -> SyncPostgrestClient:
270271
"""Private helper for creating an instance of the Postgrest client."""
271272
return SyncPostgrestClient(

supabase/lib/client_options.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
SyncMemoryStorage,
99
SyncSupportedStorage,
1010
)
11-
from httpx import AsyncClient as HttpxAsyncClient
12-
from httpx import Client as HttpxClient
11+
from httpx import AsyncClient as AsyncHttpxClient
12+
from httpx import Client as SyncHttpxClient
1313
from httpx import Timeout
1414
from postgrest.constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
1515
from storage3.constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
@@ -45,7 +45,7 @@ class ClientOptions:
4545
realtime: Optional[RealtimeClientOptions] = None
4646
"""Options passed to the realtime-py instance"""
4747

48-
httpx_client: Union[HttpxClient] = None
48+
httpx_client: Union[SyncHttpxClient] = None
4949
"""Options passed to the realtime-py instance"""
5050

5151
postgrest_client_timeout: Union[int, float, Timeout] = (
@@ -72,7 +72,7 @@ def replace(
7272
persist_session: Optional[bool] = None,
7373
storage: Optional[SyncSupportedStorage] = None,
7474
realtime: Optional[RealtimeClientOptions] = None,
75-
httpx_client: Optional[HttpxClient] = None,
75+
httpx_client: Optional[SyncHttpxClient] = None,
7676
postgrest_client_timeout: Union[
7777
int, float, Timeout
7878
] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
@@ -115,7 +115,7 @@ def replace(
115115
persist_session: Optional[bool] = None,
116116
storage: Optional[AsyncSupportedStorage] = None,
117117
realtime: Optional[RealtimeClientOptions] = None,
118-
httpx_client: Optional[HttpxAsyncClient] = None,
118+
httpx_client: Optional[AsyncHttpxClient] = None,
119119
postgrest_client_timeout: Union[
120120
int, float, Timeout
121121
] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
@@ -155,7 +155,7 @@ def replace(
155155
persist_session: Optional[bool] = None,
156156
storage: Optional[SyncSupportedStorage] = None,
157157
realtime: Optional[RealtimeClientOptions] = None,
158-
httpx_client: Optional[HttpxClient] = None,
158+
httpx_client: Optional[SyncHttpxClient] = None,
159159
postgrest_client_timeout: Union[
160160
int, float, Timeout
161161
] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,

0 commit comments

Comments
 (0)