frictionless-r
frictionless-r copied to clipboard
127 compare header and schema
check_schema()
fails on case mismatch between schema and data. To replicate:
# create package with the wrong case in the schema of observations
wrong_case_in_schema_pkg <- example_package
## change case
purrr::pluck(wrong_case_in_schema_pkg, "resources", 2, "schema", "fields") <-
purrr::chuck(wrong_case_in_schema_pkg, "resources", 2, "schema", "fields") %>%
purrr::map2_chr(
c(TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE), #set some to upper, some to lower case
~ ifelse(.y,
toupper(purrr::chuck(.x, "name")),
tolower(purrr::chuck(.x, "name"))
)
)
read_resource(wrong_case_in_schema_pkg, "observations")
Fails on:
https://github.com/frictionlessdata/frictionless-r/blob/7dba18d98afe46480367ef2f878160efecb7e629/R/check_schema.R#L19-L20
Error in `purrr::map_chr()` at frictionless-r/R/check_schema.R:20:2:
ℹ In index: 1.
Caused by error in `.x$name`:
! $ operator is invalid for atomic vectors
Run `rlang::last_trace()` to see where the error occurred.