You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should not crash, and should behave as it does on other keys, such as price:
In [27]: x=api.iex.Stock(['AAPL', 'MSFT'])
In [28]: x.get_price()
Out[28]: {'AAPL': 135.37, 'MSFT': 244.99}
Actual behavior
In [29]: x.get_beta()
---------------------------------------------------------------------------KeyErrorTraceback (mostrecentcalllast)
<ipython-input-29-67c5fe7c40d7>in<module>---->1x.get_beta()
~/rh/.venv/lib/python3.9/site-packages/iexfinance/stocks/base.pyinget_beta(self)
870871defget_beta(self):
-->872returnself._get_field("key_stats", "beta")
873874defget_short_interest(self):
~/rh/.venv/lib/python3.9/site-packages/iexfinance/stocks/base.pyin_get_field(self, endpoint, field)
91raiseNotImplementedError("Endpoint %s not implemented."%endpoint)
92iffieldnotindata:
--->93raiseKeyError("Field %s not found in %s."% (field, endpoint))
94ifself.output_format=="json":
95ifself.single_symbol:
KeyError: 'Field beta not found in key_stats.'
Additional Info
In [30]: xOut[30]: Stock(symbols=AAPL,MSFT, output_format='json')
In [31]: api.iexOut[31]: <module'iexfinance.stocks'from'/Users/nimbler/rh/.venv/lib/python3.9/site-packages/iexfinance/stocks/__init__.py'>
% pip list|grep iex
iexfinance 0.5.0
The text was updated successfully, but these errors were encountered:
Summary (include Python version)
Crash when hitting the market (aggregate) endpoint, for some specific keys.
Date/time of issue
Expected behavior
It should not crash, and should behave as it does on other keys, such as
price
:Actual behavior
Additional Info
% pip list|grep iex iexfinance 0.5.0
The text was updated successfully, but these errors were encountered: