Skip to content

Commit 74985e2

Browse files
committed
fix: update with correct httpx client class
1 parent 44fc016 commit 74985e2

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
@@ -5,7 +5,7 @@
55

66
from gotrue import AsyncMemoryStorage
77
from gotrue.types import AuthChangeEvent, Session
8-
from httpx import AsyncClient, Timeout
8+
from httpx import Timeout
99
from postgrest import (
1010
AsyncPostgrestClient,
1111
)
@@ -17,6 +17,7 @@
1717
from supafunc import AsyncFunctionsClient
1818

1919
from ..lib.client_options import AsyncClientOptions as ClientOptions
20+
from ..lib.client_options import AsyncHttpxClient
2021
from .auth_client import AsyncSupabaseAuthClient
2122

2223

@@ -268,7 +269,7 @@ def _init_postgrest_client(
268269
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
269270
verify: bool = True,
270271
proxy: Optional[str] = None,
271-
client: Union[AsyncClient, None] = None,
272+
client: Union[AsyncHttpxClient, None] = None,
272273
) -> AsyncPostgrestClient:
273274
"""Private helper for creating an instance of the Postgrest client."""
274275
return AsyncPostgrestClient(

supabase/_sync/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 SyncMemoryStorage
66
from gotrue.types import AuthChangeEvent, Session
7-
from httpx import SyncClient, Timeout
7+
from httpx import Timeout
88
from postgrest import (
99
SyncPostgrestClient,
1010
)
@@ -16,6 +16,7 @@
1616
from supafunc import SyncFunctionsClient
1717

1818
from ..lib.client_options import SyncClientOptions as ClientOptions
19+
from ..lib.client_options import SyncHttpxClient
1920
from .auth_client import SyncSupabaseAuthClient
2021

2122

@@ -267,7 +268,7 @@ def _init_postgrest_client(
267268
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
268269
verify: bool = True,
269270
proxy: Optional[str] = None,
270-
client: Union[SyncClient, None] = None,
271+
client: Union[SyncHttpxClient, None] = None,
271272
) -> SyncPostgrestClient:
272273
"""Private helper for creating an instance of the Postgrest client."""
273274
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)