Closed takuta98 closed 3 years ago
When I ran the following code on version 0.0.10, I got an error. Why?
import sys from yahoo_finance_api2 import share from yahoo_finance_api2.exceptions import YahooFinanceError my_share = share.Share('MSFT') symbol_data = None try: symbol_data = my_share.get_historical(share.PERIOD_TYPE_DAY, 10, share.FREQUENCY_TYPE_MINUTE, 5) except YahooFinanceError as e: print(e.message) sys.exit(1) print(symbol_data)
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-1-982e03b83e66> in <module>() 10 10, 11 share.FREQUENCY_TYPE_MINUTE, ---> 12 5) 13 except YahooFinanceError as e: 14 print(e.message) /usr/local/lib/python3.7/dist-packages/yahoo_finance_api2/share.py in get_historical(self, period_type, period, frequency_type, frequency) 52 'low': data['indicators']['quote'][0]['low'], 53 'close': data['indicators']['quote'][0]['close'], ---> 54 'adj_close': data['indicators']['quote'][0]['adj_close'], 55 'volume': data['indicators']['quote'][0]['volume'] 56 } KeyError: 'adj_close'
I just removed the offending code. It came from a pull request this weekend.
When I ran the following code on version 0.0.10, I got an error. Why?