Skip to content

Commit

Permalink
Merge pull request #60 from Public-Health-Scotland/bug/incorrect_pars…
Browse files Browse the repository at this point in the history
…ing_warning

Don't guess column types from first 1000 rows when parsing content from a response
  • Loading branch information
csillasch authored Feb 5, 2025
2 parents 0d2014d + 0162a48 commit 522227f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions R/phs_GET.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ phs_GET <- function(action, query, verbose = FALSE, call = rlang::caller_env())
}

# Extract the content from the HTTP response
content <- httr::content(
response
)
content <- httr::content(response, guess_max = Inf)

# detect/handle errors
error_check(content, call = call)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-get_resource.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ test_that("returns data in the expected format", {

expect_named(data_q, c("PracticeCode", "AddressLine1"))
expect_equal(data_q[["PracticeCode"]], 10002)

expect_no_warning(get_resource("3e86b6fb-2062-4f05-8f4d-0bb001155d64"))
})

test_that("returns data with row specifications", {
Expand Down

0 comments on commit 522227f

Please sign in to comment.