dle07 / cointoss

0 stars 0 forks source link

yfinance library caching issue? #7

Open hzco opened 1 year ago

hzco commented 1 year ago

There is a occasional bug where the ML_Models server will report that a ticker symbol is already cached and the server will stop responding to further requests. Error seems to be from the yfinance library.

I will update with a picture and reproduction steps if it happens again.

hzco commented 1 year ago

Exception in thread Thread-1 (_run_via_pool): Traceback (most recent call last): File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run self._target(*self._args, *self._kwargs) File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\site-packages\multitasking__init__.py", line 104, in _run_via_pool return callee(args, **kwargs) File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\site-packages\yfinance\multi.py", line 199, in _download_one_threaded data = _download_one(ticker, start, end, auto_adjust, back_adjust, File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\site-packages\yfinance\multi.py", line 213, in _download_one return Ticker(ticker).history(period=period, interval=interval, File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\site-packages\yfinance\base.py", line 154, in history tz = self._get_ticker_tz() File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\site-packages\yfinance\base.py", line 343, in _get_ticker_tz utils.cache_store_tkr_tz(self.ticker, tkr_tz) File "C:\Users\Henry\AppData\Local\Programs\Python\Python310\lib\site-packages\yfinance\utils.py", line 355, in cache_store_tkr_tz raise Exception("Tkr {} tz already in cache".format(tkr)) Exception: Tkr TOPS tz already in cache