pydata / pandas-datareader

Extract data from a wide range of Internet sources into a pandas DataFrame.
https://pydata.github.io/pandas-datareader/stable/index.html
Other
2.92k stars 682 forks source link

fix exception for no data with `YahooDailyReader` #994

Open Borda opened 1 month ago

Borda commented 1 month ago

addresses issue when data are not found in requested page, to reproduce:

import pandas_datareader.data as web

# Fetch stock data using pandas_datareader
def fetch_stock_data(symbol='AAPL', start_date='2020-01-01', end_date='2021-01-01'):
    df = web.DataReader(symbol, 'yahoo', start_date, end_date)
    return df['Close'].values

print(fetch_stock_data())

cc: @bashtage

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.88%. Comparing base (a1cf7a2) to head (74f9a90).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #994 +/- ## ========================================== - Coverage 68.34% 66.88% -1.47% ========================================== Files 65 65 Lines 2894 2893 -1 Branches 463 463 ========================================== - Hits 1978 1935 -43 - Misses 838 882 +44 + Partials 78 76 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.