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

covid_hosp_state_timeseries silently ignores as_of parameter #209

Closed
brookslogan opened this issue Nov 6, 2023 · 3 comments · Fixed by #219
Closed

covid_hosp_state_timeseries silently ignores as_of parameter #209

brookslogan opened this issue Nov 6, 2023 · 3 comments · Fixed by #219
Assignees
Labels
bug Something isn't working

Comments

@brookslogan
Copy link
Contributor

library(epidatr)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
pub_covid_hosp_state_timeseries(
  "ut", epirange(12340101, 34560101),
  as_of = 20220101,
  fetch_args = fetch_args_list(
    fields = c("state","geocoded_state","date","issue","previous_day_admission_influenza_confirmed","previous_day_admission_influenza_confirmed_coverage"),
    disable_date_parsing = TRUE
  )
) |>
  count(issue)
#> # A tibble: 1 × 2
#>      issue     n
#>      <int> <int>
#> 1 20231103  1318
# see URL:
pub_covid_hosp_state_timeseries(
  "ut", epirange(12340101, 34560101),
  as_of = 20220101,
  fetch_args = fetch_args_list(
    fields = c("state","geocoded_state","date","issue","previous_day_admission_influenza_confirmed","previous_day_admission_influenza_confirmed_coverage"),
    disable_date_parsing = TRUE,
    dry_run = TRUE
  )
)
#> 
#> ── <epidata_call> object: ──────────────────────────────────────────────────────
#> • Pipe this object into `fetch()` to actually fetch the data
#> • Request URL:
#>   https://api.delphi.cmu.edu/epidata/covid_hosp_state_timeseries/?states=ut&dates=12340101-34560101

Created on 2023-11-06 with reprex v2.0.2

@brookslogan brookslogan added the bug Something isn't working label Nov 6, 2023
@capnrefsmmat
Copy link
Contributor

capnrefsmmat commented Nov 6, 2023

I think this is a consequence of #201, right? Does the endpoint actually support as_of?

@brookslogan
Copy link
Contributor Author

I know the backing DB table has the version history. And it appears the server code is designed to handle as_of.

@brookslogan
Copy link
Contributor Author

But the epidatr function does not appear to take as_of. So silently ignoring is sort of #201, but we should be accepting&using, rather than rejecting, as_of parameters instead of ignoring them.

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.

4 participants