Skip to content
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

Raise YfRateLimitError if Rate Limited #2180

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

dhruvan2006
Copy link
Contributor

@dhruvan2006 dhruvan2006 commented Dec 15, 2024

Changes

  • New YfRateLimitError exception class, which is raised regardless of raise_errors
  • Raises the above exception if the response from Yahoo! Finance returns 429 status code.

Usage

Tricky. Can test it with any yfinance function. Would need to spam Yahoo! Finance until you get rate limited. But here is an example of how it looks:

image

@dhruvan2006 dhruvan2006 force-pushed the rate-limit-exception branch 2 times, most recently from 50d5e84 to 0ac3474 Compare December 15, 2024 16:41
@dhruvan2006
Copy link
Contributor Author

@ValueRaider

@ValueRaider
Copy link
Collaborator

I'd like to see more comments from users, maybe crosspost this into relevant Issues.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Dec 21, 2024

Will this raise in case of issue #2185? If yes then definite merge. Btw this should raise regardless of raise_errors argument, the user needs to take immediate action! So revert the change to raise_errors.

Situation is different to a loop where one ticker is delisted, the loop should continue, this is why raise_errors exists

@dhruvan2006
Copy link
Contributor Author

Will this raise in case of issue #2185? If yes then definite merge. Btw this should raise regardless of raise_errors argument, the user needs to take immediate action! So revert the change to raise_errors.

Situation is different to a loop where one ticker is delisted, the loop should continue, this is why raise_errors exists

Yes it will raise for #2185, I was testing it. Changes to raise_errors reverted and rate limit will always be raised regardless.

@ValueRaider ValueRaider merged commit ae7f371 into ranaroussi:dev Dec 22, 2024
2 checks passed
@ValueRaider ValueRaider mentioned this pull request Jan 18, 2025
@ValueRaider ValueRaider changed the title Raise Exception if Rate Limited Raise YfRateLimitError if Rate Limited Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants