Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit d34d99e

Browse files
committed
change client property name to standardise with the auth client
1 parent f0765d0 commit d34d99e

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

postgrest/_async/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(
3030
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
3131
verify: bool = True,
3232
proxy: Optional[str] = None,
33-
client: Union[AsyncClient, None] = None,
33+
http_client: Union[AsyncClient, None] = None,
3434
) -> None:
3535
BasePostgrestClient.__init__(
3636
self,
@@ -40,7 +40,7 @@ def __init__(
4040
timeout=timeout,
4141
verify=verify,
4242
proxy=proxy,
43-
client=client,
43+
http_client=http_client,
4444
)
4545
self.session = cast(AsyncClient, self.session)
4646

@@ -51,12 +51,12 @@ def create_session(
5151
timeout: Union[int, float, Timeout],
5252
verify: bool = True,
5353
proxy: Optional[str] = None,
54-
client: Union[AsyncClient, None] = None,
54+
http_client: Union[AsyncClient, None] = None,
5555
) -> AsyncClient:
56-
if client is not None:
57-
client.base_url = base_url
58-
client.headers = headers
59-
return client
56+
if http_client is not None:
57+
http_client.base_url = base_url
58+
http_client.headers = headers
59+
return http_client
6060

6161
return AsyncClient(
6262
base_url=base_url,

postgrest/_sync/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(
3030
timeout: Union[int, float, Timeout] = DEFAULT_POSTGREST_CLIENT_TIMEOUT,
3131
verify: bool = True,
3232
proxy: Optional[str] = None,
33-
client: Union[SyncClient, None] = None,
33+
http_client: Union[SyncClient, None] = None,
3434
) -> None:
3535
BasePostgrestClient.__init__(
3636
self,
@@ -40,7 +40,7 @@ def __init__(
4040
timeout=timeout,
4141
verify=verify,
4242
proxy=proxy,
43-
client=client,
43+
http_client=http_client,
4444
)
4545
self.session = cast(SyncClient, self.session)
4646

@@ -51,12 +51,12 @@ def create_session(
5151
timeout: Union[int, float, Timeout],
5252
verify: bool = True,
5353
proxy: Optional[str] = None,
54-
client: Union[SyncClient, None] = None,
54+
http_client: Union[SyncClient, None] = None,
5555
) -> SyncClient:
56-
if client is not None:
57-
client.base_url = base_url
58-
client.headers = headers
59-
return client
56+
if http_client is not None:
57+
http_client.base_url = base_url
58+
http_client.headers = headers
59+
return http_client
6060

6161
return SyncClient(
6262
base_url=base_url,

postgrest/base_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(
2020
timeout: Union[int, float, Timeout],
2121
verify: bool = True,
2222
proxy: Optional[str] = None,
23-
client: Union[SyncClient, AsyncClient, None] = None,
23+
http_client: Union[SyncClient, AsyncClient, None] = None,
2424
) -> None:
2525
if not is_http_url(base_url):
2626
ValueError("base_url must be a valid HTTP URL string")
@@ -34,14 +34,14 @@ def __init__(
3434
self.timeout = timeout
3535
self.verify = verify
3636
self.proxy = proxy
37-
self.client = client
37+
self.http_client = http_client
3838
self.session = self.create_session(
3939
self.base_url,
4040
self.headers,
4141
self.timeout,
4242
self.verify,
4343
self.proxy,
44-
self.client,
44+
self.http_client,
4545
)
4646

4747
@abstractmethod
@@ -52,7 +52,7 @@ def create_session(
5252
timeout: Union[int, float, Timeout],
5353
verify: bool = True,
5454
proxy: Optional[str] = None,
55-
client: Union[SyncClient, AsyncClient, None] = None,
55+
http_client: Union[SyncClient, AsyncClient, None] = None,
5656
) -> Union[SyncClient, AsyncClient]:
5757
raise NotImplementedError()
5858

0 commit comments

Comments
 (0)