Skip to content

Commit 1f96682

Browse files
committed
Remove timeout from poll method and LroOptions.
1 parent a1c3bfe commit 1f96682

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

databricks/sdk/common/lro.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ def __init__(self, *, timeout: Optional[timedelta] = None):
1212
"""
1313
Args:
1414
timeout: The timeout for the Long Running Operations.
15-
If not set, the default timeout is 20 minutes.
1615
"""
17-
self.timeout = timeout or timedelta(minutes=20)
16+
self.timeout = timeout

databricks/sdk/retries.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _backoff(attempt: int) -> float:
103103

104104
def poll(
105105
fn: Callable[[], Tuple[Optional[T], Optional[RetryError]]],
106-
timeout: timedelta = timedelta(minutes=20),
106+
timeout: Optional[timedelta] = None,
107107
clock: Optional[Clock] = None,
108108
) -> T:
109109
"""Poll a function until it succeeds or times out.
@@ -118,7 +118,7 @@ def poll(
118118
Return (None, RetryError.continues("msg")) to continue polling.
119119
Return (None, RetryError.halt(err)) to stop with error.
120120
Return (result, None) on success.
121-
:param timeout: Maximum time to poll (default: 20 minutes)
121+
:param timeout: Maximum time to poll. If None, polls indefinitely.
122122
:param clock: Clock implementation for testing (default: RealClock)
123123
:returns: The result of the successful function call
124124
:raises TimeoutError: If the timeout is reached
@@ -138,7 +138,7 @@ def check_operation():
138138
if clock is None:
139139
clock = RealClock()
140140

141-
deadline = clock.time() + timeout.total_seconds()
141+
deadline = float("inf") if timeout is None else clock.time() + timeout.total_seconds()
142142
attempt = 0
143143
last_err = None
144144

0 commit comments

Comments
 (0)