jonkeane commented on a change in pull request #11892:
URL: https://github.com/apache/arrow/pull/11892#discussion_r765138850
##########
File path: r/tests/testthat/test-dataset-csv.R
##########
@@ -288,3 +289,12 @@ test_that("Column names inferred from schema for
headerless CSVs (ARROW-14063)",
ds <- open_dataset(headerless_csv_dir, format = "csv", schema = schema(int =
int32(), dbl = float64()))
expect_equal(ds %>% collect(), tbl)
})
+
+test_that("open_dataset() deals with BOMs (byte-order-marks) correctly", {
+ writeLines("\xef\xbb\xbfa,b\n1,2\n", con = csv_file)
+
+ expect_equal(
+ open_dataset(csv_file, format = "csv") %>% collect(),
+ tibble(a = 1, b = 2)
+ )
Review comment:
Would it be possible to make two csv files and read those in as a
dataset? This _should_ work just the same, but it would be good to confirm that
the second csv has the proper BOM handling as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]