Commits


Nic Crane authored and GitHub committed f0303652b49
ARROW-17699: [R] Add better error message for if a non-schema passed into open_dataset() (#14108) Example below shows what happens if the `schema()` function is passed in as the `schema` argument via the `...` argument to `open_dataset()`. Before (a later check for something else catches it, this giving a misleading message): ``` library(dplyr) library(arrow) tf <- tempfile() dir.create(tf) write_dataset(mtcars, tf, format = "csv") open_dataset(tf, format = "csv", schema = schema) %>% collect() #> Error in `CsvFileFormat$create()`: #> ! Values in `column_names` must match `schema` field names #> ✖ `column_names` and `schema` field names match but are not in the same order ``` After (more accurate error message): ``` library(dplyr) library(arrow) tf <- tempfile() dir.create(tf) write_dataset(mtcars, tf, format = "csv") open_dataset(tf, format = "csv", schema = schema) %>% collect() #> Error in `CsvFileFormat$create()`: #> ! `schema` must be an object of class 'Schema' not 'function'. ``` Authored-by: Nic Crane <thisisnic@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>