thisisnic commented on code in PR #37658:
URL: https://github.com/apache/arrow/pull/37658#discussion_r1338725604


##########
r/tests/testthat/test-dataset-csv.R:
##########
@@ -593,3 +593,36 @@ test_that("CSVReadOptions field access", {
   expect_equal(options$block_size, 1048576L)
   expect_equal(options$encoding, "UTF-8")
 })
+
+test_that("GH-34640 - CSV datasets are read in correctly when both schema and 
partitioning supplied", {
+
+  target_schema <- schema(
+      int = int64(), dbl = float16(), lgl = bool(), chr = utf8(),
+      fct = utf8(), ts = timestamp(unit = "s"), part = int32()
+    )
+
+  ds <- open_dataset(
+    csv_dir,
+    partitioning = schema(part = int32()),
+    format = "csv",
+    schema = target_schema,
+    skip = 1
+  )
+  expect_r6_class(ds$format, "CsvFileFormat")
+  expect_r6_class(ds$filesystem, "LocalFileSystem")
+  expect_identical(names(ds), c(names(df1), "part"))
+  expect_identical(dim(ds), c(20L, 7L))
+  expect_equal(schema(ds), target_schema)
+

Review Comment:
   Good call, updated now!



-- 
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]

Reply via email to