|
2 | 2 | importrandom |
3 | 3 | importtime |
4 | 4 | importtyping |
| 5 | +fromimportlib.metadataimportversion |
5 | 6 | fromenumimportEnum |
6 | 7 | fromtypingimportList,Optional,Tuple,Union |
7 | 8 |
|
|
16 | 17 | fromurllib3importHTTPResponseasBaseHTTPResponse |
17 | 18 | fromurllib3importRetry |
18 | 19 | fromurllib3.util.retryimportRequestHistory |
19 | | -frompackagingimportversion |
20 | 20 |
|
21 | 21 |
|
22 | 22 | fromdatabricks.sql.excimport ( |
@@ -312,7 +312,9 @@ def get_backoff_time(self) -> float: |
312 | 312 |
|
313 | 313 | current_attempt=self.stop_after_attempts_count-int(self.totalor0) |
314 | 314 | proposed_backoff= (2**current_attempt)*self.delay_min |
315 | | -ifversion.parse(urllib3.__version__)>=version.parse("2.0.0"): |
| 315 | + |
| 316 | +library_version=version("urllib3") |
| 317 | +ifint(library_version.split(".")[0])>=2: |
316 | 318 | ifself.backoff_jitter!=0.0: |
317 | 319 | proposed_backoff+=random.random()*self.backoff_jitter |
318 | 320 |
|
|