Skip to content

Commit

Permalink
PR feedback: rename property
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Whitehouse <[email protected]>
  • Loading branch information
Jesse Whitehouse committed Aug 9, 2023
1 parent 88e8a11 commit c80a5ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/databricks/sql/auth/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self.delay_min = delay_min
self.stop_after_attempts_count = stop_after_attempts_count
self.stop_after_attempts_duration = stop_after_attempts_duration
self.delay_default = delay_default
self._delay_default = delay_default
self.force_dangerous_codes = force_dangerous_codes

# the urllib3 kwargs are a mix of configuration (some of which we override)
Expand Down Expand Up @@ -236,13 +236,15 @@ def command_type(self, value: CommandType) -> None:
self._command_type = value

@property
def get_operation_status_delay(self) -> float:
def delay_default(self) -> float:
"""Time in seconds the connector will wait between requests polling a GetOperationStatus Request
This property is never read by urllib3 for the purpose of retries. It's stored in this class
to keep all retry logic in one place
to keep all retry logic in one place.
This property is only set by __init__ and cannot be modified afterward.
"""
return self.delay_default
return self._delay_default

def start_retry_timer(self) -> None:
"""Timer is used to monitor the overall time across successive requests
Expand Down
2 changes: 1 addition & 1 deletion src/databricks/sql/thrift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def attempt_request(attempt):
if method.__name__ == gos_name:
delay_default = (
self.enable_v3_retries
and self.retry_policy.get_operation_status_delay
and self.retry_policy.delay_default
or self._retry_delay_default
)
retry_delay = bound_retry_delay(attempt, delay_default)
Expand Down

0 comments on commit c80a5ee

Please sign in to comment.