diff --git a/databricks/sdk/common/lro.py b/databricks/sdk/common/lro.py index 13c9f228d..c0aa58080 100644 --- a/databricks/sdk/common/lro.py +++ b/databricks/sdk/common/lro.py @@ -12,6 +12,6 @@ def __init__(self, *, timeout: Optional[timedelta] = None): """ Args: timeout: The timeout for the Long Running Operations. - If not set, the default timeout is 20 minutes. + if not set, then operation will wait forever. """ - self.timeout = timeout or timedelta(minutes=20) + self.timeout = timeout diff --git a/databricks/sdk/retries.py b/databricks/sdk/retries.py index a6cf5d8dc..2f6958a30 100644 --- a/databricks/sdk/retries.py +++ b/databricks/sdk/retries.py @@ -103,7 +103,7 @@ def _backoff(attempt: int) -> float: def poll( fn: Callable[[], Tuple[Optional[T], Optional[RetryError]]], - timeout: timedelta = timedelta(minutes=20), + timeout: Optional[timedelta] = None, clock: Optional[Clock] = None, ) -> T: """Poll a function until it succeeds or times out. @@ -118,7 +118,7 @@ def poll( Return (None, RetryError.continues("msg")) to continue polling. Return (None, RetryError.halt(err)) to stop with error. Return (result, None) on success. - :param timeout: Maximum time to poll (default: 20 minutes) + :param timeout: Maximum time to poll. If None, polls indefinitely. :param clock: Clock implementation for testing (default: RealClock) :returns: The result of the successful function call :raises TimeoutError: If the timeout is reached @@ -138,7 +138,7 @@ def check_operation(): if clock is None: clock = RealClock() - deadline = clock.time() + timeout.total_seconds() + deadline = float("inf") if timeout is None else clock.time() + timeout.total_seconds() attempt = 0 last_err = None