beanumber / etl

R package to facilitate ETL operations
127 stars 21 forks source link

etl_transform.etl_cities() broken, but only on R CMD check()? #37

Closed beanumber closed 10 months ago

beanumber commented 6 years ago

I'm stumped.

devtools::test()

works just fine. But it fails during

devtools::check()
Status: 1 ERROR
checking tests ... ERROR
  Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  32: readr::parse_number(world_cities$Population..4)
  33: parse_vector(x, col_number(), na = na, locale = locale)
  34: warn_problems(parse_vector_(x, collector, na = na, locale_ = locale))
  35: n_problems(x)
  36: probs(x)
  37: suppressWarnings(x)
  38: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  39: parse_vector_(x, collector, na = na, locale_ = locale)

  testthat results ================================================================
  OK: 29 SKIPPED: 0 FAILED: 1
  1. Error: cities works (@test-etl.R#113) 

  Error: testthat unit tests failed
  Execution halted

The offending line of code is

world_cities$city_pop <- readr::parse_number(world_cities$`Population..4`)

I have also tried

world_cities <- mutate_(city_pop = ~readr::parse_number(`Population..4`))

Any ideas?

beanumber commented 6 years ago

This did not solve the problem (https://github.com/hadley/testthat/issues/144)

beanumber commented 6 years ago

It also passes the check on Travis with the release version of R, but fails on win-builder.

beanumber commented 6 years ago

(https://stackoverflow.com/questions/46334054/devtoolstest-works-but-devtoolscheck-doesnt-why)