File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 22import random
33import time
44import typing
5+ from importlib .metadata import version
56from enum import Enum
67from typing import List , Optional , Tuple , Union
78
1617 from urllib3 import HTTPResponse as BaseHTTPResponse
1718from urllib3 import Retry
1819from urllib3 .util .retry import RequestHistory
19- from packaging import version
2020
2121
2222from databricks .sql .exc import (
@@ -312,7 +312,9 @@ def get_backoff_time(self) -> float:
312312
313313 current_attempt = self .stop_after_attempts_count - int (self .total or 0 )
314314 proposed_backoff = (2 ** current_attempt ) * self .delay_min
315- if version .parse (urllib3 .__version__ ) >= version .parse ("2.0.0" ):
315+
316+ library_version = version ("urllib3" )
317+ if int (library_version .split ("." )[0 ]) >= 2 :
316318 if self .backoff_jitter != 0.0 :
317319 proposed_backoff += random .random () * self .backoff_jitter
318320
You can’t perform that action at this time.
0 commit comments