Skip to content

Commit 9b858c5

Browse files
committed
fix: only_supports_classic was parsed incorrectly
1 parent afd4773 commit 9b858c5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

R/cache.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ cache_info <- function() {
256256
#'
257257
#' @keywords internal
258258
check_is_cachable <- function(epidata_call, fetch_args) {
259-
as_of_cachable <- (!is.null(epidata_call$params$as_of) && !identical(epidata_call$params$as_of, "*"))
260-
issues_cachable <- (!is.null(epidata_call$params$issues) && all(!identical(epidata_call$params$issues, "*")))
259+
as_of_cachable <- !is.null(epidata_call$params$as_of) && !identical(epidata_call$params$as_of, "*")
260+
issues_cachable <- !is.null(epidata_call$params$issues) && !identical(epidata_call$params$issues, "*")
261261
is_cachable <- (
262262
# Cache should be enabled
263263
!is.null(cache_environ$epidatr_cache) &&

R/epidatacall.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ fetch <- function(epidata_call, fetch_args = fetch_args_list()) {
261261

262262
# Need to actually get the data, since its either not in the cache or we're not caching
263263
runtime <- system.time(if (epidata_call$only_supports_classic) {
264+
fetch_args[["disable_data_frame_parsing"]] <- TRUE
264265
fetched <- fetch_classic(epidata_call, fetch_args)
265266
} else {
266267
response_content <- fetch_classic(epidata_call, fetch_args = fetch_args)

tests/testthat/test-epidatacall.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ test_that("fetch classic works", {
162162
content = function(...) readRDS(testthat::test_path("data/test-classic-only.rds")),
163163
.package = "httr"
164164
)
165-
# make sure that fetch actually uses the classic method on endpoints that only support the classic
165+
166+
# make sure the return from this is a list
166167
fetch_out <- epidata_call %>% fetch()
167-
fetch_classic_out <- epidata_call %>% fetch_classic()
168-
expect_identical(fetch_out, fetch_classic_out)
168+
expect_true(is.list(fetch_out))
169169
})
170170

171171
test_that("create_epidata_call basic behavior", {

0 commit comments

Comments
 (0)