Skip to content

Commit 1fbd319

Browse files
sfc-gh-mmishchenkosfc-gh-pczajka
authored andcommitted
revert type hints in SessionManager
1 parent 3be7641 commit 1fbd319

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/snowflake/connector/session_manager.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import itertools
88
import logging
99
from dataclasses import dataclass, field, replace
10-
from typing import Any, Callable, Generator, Mapping
10+
from typing import TYPE_CHECKING, Any, Callable, Generator, Mapping
1111

1212
from .compat import urlparse
1313
from .proxy import get_proxy_url
@@ -20,6 +20,9 @@
2020
from .vendored.urllib3.poolmanager import ProxyManager
2121
from .vendored.urllib3.util.url import parse_url
2222

23+
if TYPE_CHECKING:
24+
from .vendored.urllib3.connectionpool import HTTPConnectionPool, HTTPSConnectionPool
25+
2326
logger = logging.getLogger(__name__)
2427
REQUESTS_RETRY = 1 # requests library builtin retry
2528

@@ -56,7 +59,9 @@ def wrapper(self, *args, **kwargs):
5659
class ProxySupportAdapter(HTTPAdapter):
5760
"""This Adapter creates proper headers for Proxy CONNECT messages."""
5861

59-
def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None):
62+
def get_connection_with_tls_context(
63+
self, request, verify, proxies=None, cert=None
64+
) -> HTTPConnectionPool | HTTPSConnectionPool:
6065
proxy = select_proxy(request.url, proxies)
6166
try:
6267
host_params, pool_kwargs = self.build_connection_pool_key_attributes(

0 commit comments

Comments
 (0)