Skip to content

Can't use as_of = <Date> with caching enabled #258

Closed
@brookslogan

Description

@brookslogan

Thanks to @XuedaShen for pointing this out.

library(epidatr)
#> ! epidatr cache is being used (set env var EPIDATR_USE_CACHE=FALSE if not
#>   intended).
#> ℹ The cache directory is ~/.cache/R/epidatr.
#> ℹ The cache will be cleared after 14 days and will be pruned if it exceeds 4096
#>   MB.
#> ℹ The log of cache transactions is stored at ~/.cache/R/epidatr/logfile.txt.
pub_covidcast(
  source = "hhs",
  signals = "confirmed_admissions_covid_1d_prop_7dav",
  geo_type = "state",
  time_type = "day",
  geo_values = "*",
  time_values = epirange(20201101, 20231231),
  as_of = as.Date("2024-02-28")
)
#> Error in charToDate(x): character string is not in a standard unambiguous format

Created on 2024-02-28 with reprex v2.0.2

This is from cache_epidata_call()->check_is_recent(), probably similar to check_is_cachable() in #194.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions