Lienus10 / yoptions

MIT License
12 stars 9 forks source link

Try yahoo api v6 iof v7 fails to retrieve any data #13

Open construct22 opened 9 months ago

construct22 commented 9 months ago

created a new method url_fetch that first tries the v7 http url and if that fails, then tries the v6 version of url. If both fails return an empty data frame.

Also, used urljoin to contruct the url as if a query was made on ^SPX if was never successful since the caret is a special character in urls and needs to be quoted

joncokisler commented 2 months ago

i believe this can be merged after the commented lines are deleted @Lienus10 ?

joncokisler commented 2 months ago

I'm not sure if we want to return an empty dataframe in the case that both API versions fail, I think letting it error out would be safer, what do you think, @construct22 ?

construct22 commented 2 months ago

Yes, an empty dateframe is probably a bad idea, throwing an exception would make it obvious something went wrong.