dragosmg commented on a change in pull request #11892:
URL: https://github.com/apache/arrow/pull/11892#discussion_r765803093
##########
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:
@wjones127 @jonkeane I think the additional tests are now failing. I got
[this](https://github.com/apache/arrow/runs/4470780115?check_suite_focus=true)
in a different PR. I haven't yet rebased so I don't even have those tests in my
branch.
##########
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:
@wjones127 @jonkeane I think the additional tests are now failing. I got
[this](https://github.com/apache/arrow/runs/4470780115?check_suite_focus=true)
CI failure in a different PR. I haven't yet rebased so I don't even have those
tests in my branch.
--
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]