Closed mo-cmyk closed 2 years ago
The trouble is that API failures can occur for any number of reasons, some server-side and others on the user-side. For instance: if the user requests a DataFrame consisting of 100,000,000 data points, the server might just stop processing, and an "automatic" retry would simply over-burden the system. My suggestion to implement an exception handler outside the module was meant to suggest that users are best suited to determine why a session might be failing and address it according to the context, which I think is a better approach.
Hi, I wanted to implement the requested feature by complying with your provided code snippet: https://stackoverflow.com/questions/567622/is-there-a-pythonic-way-to-try-something-up-to-a-maximum-number-of-times. I also agree, but since you said it to be random I thought it to be the right approach.
This pull request closes issue #11 retry mechanism by retrying certain requests
retries_on_failure = 5
times until aborting the request. Instead of the current implementation where the data fetching randomly quits the program.@tgherzog Would be great if you could take a look at it.