yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

Bug on cache feature

Open leeprevost opened this issue 3 years ago • 1 comments

I think there must be a bug using the requests-cache feature:

Here is what I tried (per quickstart)

import requests_cache
import yfinance as yf

session = requests_cache.CachedSession('yfinance.cache')
ticker = yf.Ticker('msft aapl goog', session=session)

Output:

- MSFT AAPL GOOG: No data found, symbol may be delisted
- MSFT AAPL GOOG: No data found, symbol may be delisted
- MSFT AAPL GOOG: No data found, symbol may be delisted
- MSFT AAPL GOOG: No data found, symbol may be delisted
- MSFT AAPL GOOG: No data found, symbol may be delisted

leeprevost avatar Jan 16 '22 15:01 leeprevost

Hello leeprevost, the problem is not related to the requests cache feature, but to the use of yf.Ticker. You should specify only one ticker, e.g. try: ticker = yf.Ticker('msft', session=session).history()

Ale-Cas avatar Jan 31 '22 18:01 Ale-Cas