File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2
2
import random
3
3
import time
4
4
import typing
5
+ from importlib .metadata import version
5
6
from enum import Enum
6
7
from typing import List , Optional , Tuple , Union
7
8
16
17
from urllib3 import HTTPResponse as BaseHTTPResponse
17
18
from urllib3 import Retry
18
19
from urllib3 .util .retry import RequestHistory
19
- from packaging import version
20
20
21
21
22
22
from databricks .sql .exc import (
@@ -312,7 +312,9 @@ def get_backoff_time(self) -> float:
312
312
313
313
current_attempt = self .stop_after_attempts_count - int (self .total or 0 )
314
314
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 :
316
318
if self .backoff_jitter != 0.0 :
317
319
proposed_backoff += random .random () * self .backoff_jitter
318
320
You can’t perform that action at this time.
0 commit comments