Skip to content

Commit e32c858

Browse files
Revert "potential working code dump"
This reverts commit f3bc8a0.
1 parent f3bc8a0 commit e32c858

File tree

5 files changed

+101
-590
lines changed

5 files changed

+101
-590
lines changed

src/databricks/sql/auth/retry.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(
127127
total=_attempts_remaining,
128128
respect_retry_after_header=True,
129129
backoff_factor=self.delay_min,
130-
allowed_methods=["POST", "DELETE"], # Allow DELETE for CLOSE_SESSION and CLOSE_OPERATION
130+
allowed_methods=["POST"],
131131
status_forcelist=[429, 503, *self.force_dangerous_codes],
132132
)
133133

@@ -256,13 +256,6 @@ def delay_default(self) -> float:
256256
"""
257257
return self._delay_default
258258

259-
def _is_method_retryable(self, method: str) -> bool:
260-
"""Check if the given HTTP method is retryable.
261-
262-
We allow POST (for ExecuteStatement) and DELETE (for CloseSession/CloseOperation).
263-
"""
264-
return method.upper() in ["POST", "DELETE"]
265-
266259
def start_retry_timer(self) -> None:
267260
"""Timer is used to monitor the overall time across successive requests
268261
@@ -378,9 +371,9 @@ def should_retry(self, method: str, status_code: int) -> Tuple[bool, str]:
378371
if status_code == 501:
379372
return False, "Received code 501 from server."
380373

381-
# Request failed and this method is not retryable. We retry POST and DELETE requests.
374+
# Request failed and this method is not retryable. We only retry POST requests.
382375
if not self._is_method_retryable(method):
383-
return False, "Only POST and DELETE requests are retried"
376+
return False, "Only POST requests are retried"
384377

385378
# Request failed with 404 and was a GetOperationStatus. This is not recoverable. Don't retry.
386379
if status_code == 404 and self.command_type == CommandType.GET_OPERATION_STATUS:

0 commit comments

Comments
 (0)