Commits


Nic Crane authored and GitHub committed 7f58c1a8b1b
GH-34092: [R] open_csv_dataset() error if schema supplied and col_names left as TRUE (the default) (#34217) Before this PR: ``` r library(arrow) tf <- tempfile() df <- tibble::tibble(x = 1, b = 2) write_csv_arrow(df, tf) open_csv_dataset(tf, schema = schema(x = int64(), y = int64()), skip = 1) #> Error in `check_schema()`: #> ! Values in `column_names` must match `schema` field names #> ✖ `x` and `y` not present in `column_names` #> Backtrace: #> ▆ #> 1. └─arrow (local) `<fn>`(...) #> 2. └─arrow::open_dataset(...) #> 3. └─DatasetFactory$create(...) #> 4. └─FileFormat$create(match.arg(format), ...) #> 5. └─CsvFileFormat$create(schema = schema, ...) #> 6. └─arrow:::check_schema(options[["schema"]], options[["read_options"]]$column_names) #> 7. └─rlang::abort(...) ``` After this PR: ``` r library(arrow) tf <- tempfile() df <- tibble::tibble(x = 1, b = 2) write_csv_arrow(df, tf) open_csv_dataset(tf, schema = schema(x = int64(), y = int64()), skip = 1) #> FileSystemDataset with 1 csv file #> x: int64 #> y: int64 ``` * Closes: #34092 Authored-by: Nic Crane <thisisnic@gmail.com> Signed-off-by: Jacob Wujciak-Jens <jacob@wujciak.de>