Replies: 2 comments 9 replies
-
Looks like a simple oversight, no reason Can see what "all" would look like with |
Beta Was this translation helpful? Give feedback.
-
Finally got some time to look into this so following up here! I added the the |
Beta Was this translation helpful? Give feedback.
-
Hey all, I am using yfinance to run an analysis on a basket of symbols daily after market close. I am scraping wikipedia for all s&p 500 symbols and make a list out of them and then pass that list into
yf.download
function. Occasionally, I see the download function fail to download data for a few of the symbols in the list. Is there a way to raise errors similar to theyf.Ticker(symbol).history(...)
method?Relevant code snippet where I'm using the download function:
I have noticed that every so often, a few of the symbols will fail to get data from the api for any sort of reason and the script needs to be rerun and it will succeed. Example of running and getting the failed and then rerunning and seeing a success from earlier today:
Looking through the code, I see that the download function calls the
multi.download
function which ultimately callsTicker(symbol).history(raise_errors=True, ...)
for each symbol in the list.multi.download
aggregates the errors intoshared._ERRORS
and ends up logging vialogger.error(...)
. The errors are then never thrown as an exception and I don't see a flag to set for this similar to howTicker(symbol).history(...)
does.A few questions:
Ticker(symbol).history(...)
function so that I can exit the script with a non-zero exit code to signal to my cronjob to retry?yf.Ticker(symbol).history(raise_errors=True, ...)
for all symbols in the list instead of using theyf.download
function in order to be able to see errors?Beta Was this translation helpful? Give feedback.
All reactions