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

Can't use as_of or issues with Date vector (any length) #192

Closed
brookslogan opened this issue Oct 2, 2023 · 2 comments · Fixed by #224
Closed

Can't use as_of or issues with Date vector (any length) #192

brookslogan opened this issue Oct 2, 2023 · 2 comments · Fixed by #224
Assignees
Labels
bug Something isn't working

Comments

@brookslogan
Copy link
Contributor

library(epidatr)
set_cache(days = 28L, max_size = 2e3)
pub_covidcast("hhs", "confirmed_7dav_incidence_prop", "state", "day", "*", "*", as_of=Sys.Date())
#> Error in charToDate(x): character string is not in a standard unambiguous format

Created on 2023-10-02 with reprex v2.0.2

This appears to be because of this comparison: epidata_call$params$as_of != "*" which appears to attempt date conversion on "*". Note we don't even support as_of="*" in the API, which would be extremely large (returning full snapshots for every version), only issues="*".

@brookslogan brookslogan changed the title Error when checking if as_of="*" Error when checking if as_of=="*" when caching Oct 2, 2023
@brookslogan
Copy link
Contributor Author

Same thing happens when specifying a single date in issues =, and some other error message or warning + bad behavior may happen with issues = date vector.

Maybe these checks should be done with identical.

@dsweber2 dsweber2 added this to the 1.2 release milestone Oct 2, 2023
@dsweber2 dsweber2 added the bug Something isn't working label Oct 2, 2023
@brookslogan brookslogan changed the title Error when checking if as_of=="*" when caching Error checking if as_of=="*" blocking use of as_of Oct 5, 2023
@brookslogan brookslogan changed the title Error checking if as_of=="*" blocking use of as_of Error checking if as_of=="*" blocking use of as_of and issues queries Oct 5, 2023
@brookslogan brookslogan changed the title Error checking if as_of=="*" blocking use of as_of and issues queries Can't use as_of or issues with single Date Oct 5, 2023
@brookslogan
Copy link
Contributor Author

brookslogan commented Oct 5, 2023

This is actually blocking use of as_of and issues when using a Date vector (of any length), regardless of whether we are using caching or not. (length 1 should be supported by both. length > 1 should be supported for issues but not as_of.)

@brookslogan brookslogan changed the title Can't use as_of or issues with single Date Can't use as_of or issues with Date vector (any length) Oct 5, 2023
@nmdefries nmdefries self-assigned this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants