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

Added better error logging for API limit threshold #745

Merged
merged 2 commits into from
Apr 23, 2020

Conversation

PatrickAlphaC
Copy link
Contributor

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • passes black --check pandas_datareader
  • added entry to docs/source/whatsnew/vLATEST.txt

Now when the API rate limit is hit instead of the error being:

--> 81                 raise RemoteDataError()
     82         df = df[sorted(df.columns)]
     83         df.columns = [id[3:] for id in df.columns]

RemoteDataError: 

It will be:

pandas_datareader._utils.RemoteDataError: {'Note': 'Thank you for using Alpha Vantage! Our standard API call frequency is 5 calls per minute and 500 calls per day. Please visit https://www.alphavantage.co/premium/ if you would like to target a higher API call frequency.'}

@codecov-io
Copy link

codecov-io commented Jan 20, 2020

Codecov Report

Merging #745 into master will decrease coverage by 13.58%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #745       +/-   ##
===========================================
- Coverage   83.74%   70.15%   -13.59%     
===========================================
  Files          62       62               
  Lines        2768     2768               
  Branches      305      305               
===========================================
- Hits         2318     1942      -376     
- Misses        375      749      +374     
- Partials       75       77        +2
Impacted Files Coverage Δ
pandas_datareader/av/forex.py 22.72% <0%> (-72.73%) ⬇️
pandas_datareader/av/quotes.py 26.47% <0%> (-64.71%) ⬇️
pandas_datareader/quandl.py 29.26% <0%> (-63.42%) ⬇️
pandas_datareader/av/time_series.py 32.43% <0%> (-62.17%) ⬇️
pandas_datareader/enigma.py 23.63% <0%> (-60%) ⬇️
pandas_datareader/tiingo.py 38.29% <0%> (-57.45%) ⬇️
pandas_datareader/tests/test_quandl.py 42.59% <0%> (-57.41%) ⬇️
pandas_datareader/tests/av/test_av_time_series.py 28.4% <0%> (-51.14%) ⬇️
pandas_datareader/tests/av/test_av_forex.py 50% <0%> (-50%) ⬇️
pandas_datareader/tests/av/test_av_quotes.py 50% <0%> (-46.88%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57766a5...b345e54. Read the comment docs.

@addisonlynch
Copy link
Contributor

@PatrickAlphaVantage thanks!

@PatrickAlphaC
Copy link
Contributor Author

So it looks like the builds were failing before I made this PR, is master broken at the moment? Or did I do something silly.

@addisonlynch
Copy link
Contributor

@PatrickAlphaVantage yeah failing for different reasons

Copy link
Contributor

@bashtage bashtage left a comment

Choose a reason for hiding this comment

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

Would be best to reformat out with some text that would help user understand the error message.

pandas_datareader/av/__init__.py Outdated Show resolved Hide resolved
@bashtage
Copy link
Contributor

Thanks.

@bashtage bashtage merged commit a6c0271 into pydata:master Apr 23, 2020
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.

4 participants