Skip to content

Commit 1ccbb3b

Browse files
vdusekclaude
andcommitted
fix: use explicit None checks for client config to respect zero values
The or operator treats 0 as falsy, so passing max_retries=0 (no retries), timeout_secs=0, or min_delay_between_retries_millis=0 would silently fall back to the default values. Changed to explicit 'is not None' checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1030dab commit 1ccbb3b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/apify_client/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ def __init__(
8989
self.base_url = f'{api_url}/{API_VERSION}'
9090
api_public_url = (api_public_url or DEFAULT_API_URL).rstrip('/')
9191
self.public_base_url = f'{api_public_url}/{API_VERSION}'
92-
self.max_retries = max_retries or 8
93-
self.min_delay_between_retries_millis = min_delay_between_retries_millis or 500
94-
self.timeout_secs = timeout_secs or DEFAULT_TIMEOUT
92+
self.max_retries = max_retries if max_retries is not None else 8
93+
self.min_delay_between_retries_millis = (
94+
min_delay_between_retries_millis if min_delay_between_retries_millis is not None else 500
95+
)
96+
self.timeout_secs = timeout_secs if timeout_secs is not None else DEFAULT_TIMEOUT
9597

9698
def _options(self) -> dict:
9799
return {

0 commit comments

Comments
 (0)