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

riingo prices fails if there is any invalid tickers #6

Closed
zac-garland opened this issue Sep 7, 2018 · 4 comments · Fixed by #10
Closed

riingo prices fails if there is any invalid tickers #6

zac-garland opened this issue Sep 7, 2018 · 4 comments · Fixed by #10

Comments

@zac-garland
Copy link

Hi all,

You guys have done a great job with this package. There was one issue that I noticed which I wanted to bring to your attention. If there is a single invalid ticker, start_date, end_date, the entire call fails.

This could be problematic when calling 500 tickers, as the first 499 tickers might successfully download, but if there is one bad egg, it ruins the whole batch.

As an example:

tickers <- c("AAPL","IBM","F","BADTICKER")

riingo::riingo_prices(tickers)
#> Warning: 'glue::collapse' is deprecated.
#> Use 'glue_collapse' instead.
#> See help("Deprecated") and help("glue-deprecated").

#> Warning: 'glue::collapse' is deprecated.
#> Use 'glue_collapse' instead.
#> See help("Deprecated") and help("glue-deprecated").

#> Warning: 'glue::collapse' is deprecated.
#> Use 'glue_collapse' instead.
#> See help("Deprecated") and help("glue-deprecated").

#> Warning: 'glue::collapse' is deprecated.
#> Use 'glue_collapse' instead.
#> See help("Deprecated") and help("glue-deprecated").
#> Error: The ticker name, BADTICKER, is invalid or data is currently not available. Check ticker validity with is_supported_ticker().
#> Tiingo msg) Error: Ticker 'BADTICKER' not found

I tried to look through the source code, but found there were certain functions that weren't exported so I figured I'd post an issue.

Thanks,
Zac

@DavisVaughan
Copy link
Collaborator

Thanks! I knew about this, but hadn't implemented any safe handling. I can add it in with purrr::safely(), but it might be a bit before I get to it. Thanks for reporting!

@altanalytics
Copy link

Hi Davis. I think I found the issue. in the assertions (8), prices (1), quote (1), and url_constructor(1) file in the R folder I see a number of instances where it uses glue::collapse instead of the newer function in the tidyverse of glue_collapse. I made this fix and created a new tar file that I installed. The warning has stopped. Happy to share with you if you like

@altanalytics
Copy link

Thanks Davis. This is a great package!

@DavisVaughan
Copy link
Collaborator

Thanks! Just sent 0.2.0 to cran, hopefully all goes smoothly

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

Successfully merging a pull request may close this issue.

3 participants