Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty result crashes function #2

Open
ga-it opened this issue May 13, 2022 · 3 comments
Open

Empty result crashes function #2

ga-it opened this issue May 13, 2022 · 3 comments
Assignees

Comments

@ga-it
Copy link

ga-it commented May 13, 2022

Symbol vector includes LBSI which returns empty query result despite data on web page.

Query:

https://query2.finance.yahoo.com/v10/finance/quoteSummary/LBSI?modules=incomeStatementHistory,balanceSheetHistory,cashflowStatementHistory

Web page:

https://finance.yahoo.com/quote/LBSI/cash-flow?p=LBSI

This crashes entire yahoo_financials function:

Error in select(., -maxAge) :
select() doesn't handle lists.

@pieterprovoost pieterprovoost self-assigned this May 13, 2022
@pieterprovoost
Copy link
Owner

Thanks for reporting, I'm not sure what is going on with the API but I implemented some temporary error handling. If this doesn't get fixed at Yahoo I'll need to look into using other endpoints.

@ga-it
Copy link
Author

ga-it commented May 13, 2022

Thanks. Forked and wrapped inelegantly with

if (length(res[[1]][[1]][[1]])==0)

and returned empty dataframe.

Sure your solution will be more elegant!

;)

@ga-it
Copy link
Author

ga-it commented May 13, 2022

Thanks for reporting, I'm not sure what is going on with the API but I implemented some temporary error handling. If this doesn't get fixed at Yahoo I'll need to look into using other endpoints.

Yahoo has benefits as a source.

I am looking at putting together an RShiny markets dashboard and your functions are some of the few that elegantly grab Yahoo API data.

Other elements of the API could therefore add value to a dashboard such as assetProfile, summaryProfile, summaryDetail, calendarEvents, secFilings etc

With your fixes and disabling the FCF calc, pulled 367 global banks financial data! Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants