Skip to content

Commit f3e48dc

Browse files
authored
build: new httpcore backwards compatibility (#256)
1 parent 452bec0 commit f3e48dc

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/firebolt/async_db/connection.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import socket
55
from json import JSONDecodeError
66
from types import TracebackType
7-
from typing import Any, Dict, Iterable, List, Optional
7+
from typing import Any, Dict, List, Optional
88

99
from httpcore.backends.auto import AutoBackend
10-
from httpcore.backends.base import SOCKET_OPTION, AsyncNetworkStream
10+
from httpcore.backends.base import AsyncNetworkStream
1111
from httpx import AsyncHTTPTransport, HTTPStatusError, RequestError, Timeout
1212

1313
from firebolt.async_db.cursor import Cursor
@@ -134,16 +134,20 @@ class OverriddenHttpBackend(AutoBackend):
134134
and `KEEPIDLE` settings.
135135
"""
136136

137-
async def connect_tcp(
137+
async def connect_tcp( # type: ignore [override]
138138
self,
139139
host: str,
140140
port: int,
141141
timeout: Optional[float] = None,
142142
local_address: Optional[str] = None,
143-
socket_options: Optional[Iterable[SOCKET_OPTION]] = None,
143+
**kwargs: Any,
144144
) -> AsyncNetworkStream:
145-
stream = await super().connect_tcp(
146-
host, port, timeout=timeout, local_address=local_address
145+
stream = await super().connect_tcp( # type: ignore [call-arg]
146+
host,
147+
port,
148+
timeout=timeout,
149+
local_address=local_address,
150+
**kwargs,
147151
)
148152
# Enable keepalive
149153
stream.get_extra_info("socket").setsockopt(

src/firebolt/db/connection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import socket
55
from json import JSONDecodeError
66
from types import TracebackType
7-
from typing import Any, Dict, Iterable, List, Optional
7+
from typing import Any, Dict, List, Optional
88
from warnings import warn
99

10-
from httpcore.backends.base import SOCKET_OPTION, NetworkStream
10+
from httpcore.backends.base import NetworkStream
1111
from httpcore.backends.sync import SyncBackend
1212
from httpx import HTTPStatusError, HTTPTransport, RequestError, Timeout
1313
from readerwriterlock.rwlock import RWLockWrite
@@ -125,20 +125,20 @@ class OverriddenHttpBackend(SyncBackend):
125125
and `KEEPIDLE` settings.
126126
"""
127127

128-
def connect_tcp(
128+
def connect_tcp( # type: ignore [override]
129129
self,
130130
host: str,
131131
port: int,
132132
timeout: Optional[float] = None,
133133
local_address: Optional[str] = None,
134-
socket_options: Optional[Iterable[SOCKET_OPTION]] = None,
134+
**kwargs: Any,
135135
) -> NetworkStream:
136-
stream = super().connect_tcp(
136+
stream = super().connect_tcp( # type: ignore [call-arg]
137137
host,
138138
port,
139139
timeout=timeout,
140140
local_address=local_address,
141-
socket_options=socket_options,
141+
**kwargs,
142142
)
143143
# Enable keepalive
144144
stream.get_extra_info("socket").setsockopt(

0 commit comments

Comments
 (0)