-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
ENH Add retry mechanism to fetch_xx functions. #28160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Add retry mechanism to fetch_xx functions. #28160
Conversation
Ping @thomasjpfan and @Micky774 for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment otherwise LGTM.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
…om:fkdosilovic/scikit-learn into Add-retry-mechanism-for-fetch_xx-functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
One inconsistency I see compared to the similar functionality that was added in #21901 for
I think it would make sense to have Also not sure whether that was discussed in related issues/PRs (I looked quickly but could not find any discussion about this), but were there some thoughts about reusing the same code both in this PR and for |
I'll update the delay parameter to float.
I do not think there was any discussion about reusing the same code. After finishing this PR I can open another one with the decoupled retry mechanism into a separate function. cc @lesteve |
I jumped the here. What did you mean when you say "reusing the same code both in this PR and for fetch_openml."? Did you mean reusing the Also, please look at the cc @lesteve |
Also pointing out another inconsistency: In this PR the functions use the following constraints on delay parameter: |
It makes sense to use
This was a rather vague idea since I did not look carefully at the code, but it feels like maybe the retry code is very similar so there could be a function that is reused between the two implementations. |
Do not see why a delay time between retries should be limited to a maximum of 1 second, or confined to a range between 0 and 1 seconds. |
Actually can you use Sorry I was not explicit enough in my previous message The current code |
Yes, I believe this is the most sensible solution. |
LGTM, thanks! I fixed a conflict in the changelog and set auto-merge: this will automatically be merged when CI is green. |
So the failures are in |
Apparently we broke something. Since we skip the test for the fetcher we did not catch it. |
Reference Issues/PRs
Supersedes #21691. (Addressed the remaining comments #21691 (review))
What does this implement/fix? Explain your changes.
This PR adds
n_retries
anddelay
argument to the following functions as mentioned in #21178:The only exception is fetch_openml, which was covered in #21397.
Any other comments?
None.