Skip to content

Commit a313240

Browse files
SNOW-721249 retry http response 429 and fix olddriver tests (#1389)
1 parent 7dad8cd commit a313240

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/snowflake/connector/compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def IS_BINARY(v):
7474
BAD_GATEWAY = http.client.BAD_GATEWAY
7575
BAD_REQUEST = http.client.BAD_REQUEST
7676
REQUEST_TIMEOUT = http.client.REQUEST_TIMEOUT
77+
TOO_MANY_REQUESTS = http.client.TOO_MANY_REQUESTS
7778
SERVICE_UNAVAILABLE = http.client.SERVICE_UNAVAILABLE
7879
GATEWAY_TIMEOUT = http.client.GATEWAY_TIMEOUT
7980
FORBIDDEN = http.client.FORBIDDEN

src/snowflake/connector/network.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
OK,
3131
REQUEST_TIMEOUT,
3232
SERVICE_UNAVAILABLE,
33+
TOO_MANY_REQUESTS,
3334
UNAUTHORIZED,
3435
BadStatusLine,
3536
IncompleteRead,
@@ -181,6 +182,7 @@ def is_retryable_http_code(code: int) -> bool:
181182
FORBIDDEN, # 403
182183
METHOD_NOT_ALLOWED, # 405
183184
REQUEST_TIMEOUT, # 408
185+
TOO_MANY_REQUESTS, # 429
184186
)
185187

186188

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ basepython = python3.7
7777
description = run the old driver tests with pytest under {basepython}
7878
deps =
7979
pip >= 19.3.1
80+
pyOpenSSL==22.1.0
8081
snowflake-connector-python==1.9.1
8182
azure-storage-blob==2.1.0
8283
pandas

0 commit comments

Comments
 (0)