44import urllib .parse
55import urllib .request
66from typing import Dict , Any , Optional , List , Tuple , Union
7- from urllib .parse import urljoin
87
98from urllib3 import HTTPConnectionPool , HTTPSConnectionPool , ProxyManager
109from urllib3 .util import make_headers
1514from databricks .sql .types import SSLOptions
1615from databricks .sql .exc import (
1716 RequestError ,
18- MaxRetryDurationError ,
19- SessionAlreadyClosedError ,
20- CursorAlreadyClosedError ,
2117)
2218
2319logger = logging .getLogger (__name__ )
@@ -200,7 +196,7 @@ def close(self):
200196 self ._pool .clear ()
201197
202198 def using_proxy (self ) -> bool :
203- """Check if proxy is being used (for compatibility with Thrift client) ."""
199+ """Check if proxy is being used."""
204200 return self .realhost is not None
205201
206202 def set_retry_command_type (self , command_type : CommandType ):
@@ -255,8 +251,6 @@ def _make_request(
255251
256252 logger .debug (f"Making { method } request to { path } " )
257253
258- # When v3 retries are enabled, urllib3 handles retries internally via DatabricksRetryPolicy
259- # When disabled, we let exceptions bubble up (similar to Thrift backend approach)
260254 if self ._pool is None :
261255 raise RequestError ("Connection pool not initialized" , None )
262256
@@ -276,7 +270,6 @@ def _make_request(
276270 error_message = f"SEA HTTP request failed with status { response .status } "
277271 raise Exception (error_message )
278272 except MaxRetryError as e :
279- # urllib3 MaxRetryError should bubble up for redirect tests to catch
280273 logger .error (f"SEA HTTP request failed with MaxRetryError: { e } " )
281274 raise
282275 except Exception as e :
@@ -291,6 +284,7 @@ def _get_command_type_from_path(self, path: str, method: str) -> CommandType:
291284 This helps the retry policy make appropriate decisions for different
292285 types of SEA operations.
293286 """
287+
294288 path = path .lower ()
295289 method = method .upper ()
296290
0 commit comments