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

Fix google trends. Error: The request failed: Google returned a response with code 429. #2677

Merged
merged 15 commits into from
Sep 30, 2022

Conversation

montezdesousa
Copy link
Contributor

@montezdesousa montezdesousa commented Sep 29, 2022

This PR fix the error showing on integration tests "Error: The request failed: Google returned a response with code 429." -> too many requests : mentioned on #2612

The PR also fixes an issue with ba controller, where mentions was prompting:
image

Instead of:
image

When user tries to run mentions without any ticker loaded.

The 429 error might occur with commands: mentions, regions, queries and rise.

Integration tests: python terminal.py scripts\test_stocks_ba.openbb

api

from openbb_terminal.api import openbb

openbb.stocks.ba.mentions(symbol="AAPL")
openbb.stocks.ba.regions(symbol="AAPL")
openbb.stocks.ba.queries(symbol="AAPL")
openbb.stocks.ba.rise(symbol="AAPL")

Might me useful to overload TrendReq to get the desired error with:

for i in range(10000):
       openbb.stocks.ba.mentions(symbol="AAPL")

@montezdesousa montezdesousa marked this pull request as ready for review September 29, 2022 18:41
Copy link
Contributor

@hjoaquim hjoaquim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to add imo.
Test pass now:
image

@montezdesousa montezdesousa merged commit 31c82b6 into main Sep 30, 2022
@hjoaquim hjoaquim deleted the google_fixes branch September 30, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants