|
15 | 15 | from hamilton.registry import disable_autoload |
16 | 16 | from hamilton.telemetry import disable_telemetry |
17 | 17 | from hamilton_sdk.api.clients import UnauthorizedException |
18 | | -from requests.exceptions import HTTPError,ConnectionError |
| 18 | +from requests.exceptions import ConnectionError, HTTPError |
19 | 19 |
|
20 | 20 | from .. import settings |
21 | 21 |
|
@@ -444,9 +444,8 @@ def run( |
444 | 444 | if not isinstance(retry_exceptions, (tuple, list)): |
445 | 445 | retry_exceptions = [retry_exceptions] |
446 | 446 | retry_exceptions = [ |
447 | | - eval(exc) if isinstance(exc, str) else exc |
448 | | - for exc in retry_exceptions] |
449 | | - |
| 447 | + eval(exc) if isinstance(exc, str) else exc for exc in retry_exceptions |
| 448 | + ] |
450 | 449 |
|
451 | 450 | attempts = 1 |
452 | 451 | last_exception = None |
@@ -479,7 +478,11 @@ def run( |
479 | 478 |
|
480 | 479 | return res |
481 | 480 | except tuple(retry_exceptions) as e: |
482 | | - if isinstance(e, HTTPError) or isinstance(e, UnauthorizedException) or isinstance(e, ConnectionError): |
| 481 | + if ( |
| 482 | + isinstance(e, HTTPError) |
| 483 | + or isinstance(e, UnauthorizedException) |
| 484 | + or isinstance(e, ConnectionError) |
| 485 | + ): |
483 | 486 | if with_adapter_cfg["hamilton_tracker"]: |
484 | 487 | logger.info( |
485 | 488 | "Hamilton Tracker is enabled. Disabling tracker for the next run." |
|
0 commit comments