Closed aisthesis closed 8 years ago
It's probably best just to re-raise whatever exception Pandas raises. Everything except ValueError seems to mean that something is wrong with the connection to Yahoo, including times when Yahoo is resetting its servers.
The try-except block should just be removed at https://github.com/aisthesis/pynance/blob/master/pynance/opt/retrieve.py#L57
This is more in the spirit of this library as wrapper for pandas.
The documentation should have notes stating what exception to expect in case of bad connection. pandas_datareader
has also changed RemoteDataError
to a private exception type defined under _utils
: https://github.com/pydata/pandas-datareader/blob/master/pandas_datareader/_utils.py#L10
The reference in the pynance
comments should be deleted.
The way it is, the code is vulnerable to changes in pandas_datareader. Currently I'm getting this;
...
AttributeError: module 'pandas_datareader.data' has no attribute 'RemoteDataError'
Resolved in develop
branch
The user should get an exception that allows her to distinguish between connection errors (where retry logic will often be called for) and cases where the stock doesn't exist or doesn't have any options.
It appears that
ValueError
is raised in these cases.