Skip to content

Commit fbcd26c

Browse files
feat: add retry handling to DataFrameClient for common status codes and errors
1 parent c00fd64 commit fbcd26c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nisystemlink/clients/dataframe/_data_frame_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313
)
1414
from nisystemlink.clients.core.helpers import IteratorFileLike
1515
from requests.models import Response
16-
from uplink import Body, Field, Path, Query
16+
from uplink import Body, Field, Path, Query, retry
1717

1818
from . import models
1919

2020

21+
@retry(
22+
when=retry.when.status([429, 500, 502, 503, 504]),
23+
stop=retry.stop.after_attempt(5),
24+
on_exception=retry.CONNECTION_ERROR,
25+
)
2126
class DataFrameClient(BaseClient):
2227
def __init__(self, configuration: Optional[core.HttpConfiguration] = None):
2328
"""Initialize an instance.

0 commit comments

Comments
 (0)