From 3552c8fefd631bb75dd85c96c93ffbae12a6ee8d Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Mon, 11 Sep 2023 21:43:18 +0100 Subject: [PATCH] Change the schema to non-default to see if getting retained --- r/tests/testthat/test-dataset-csv.R | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/r/tests/testthat/test-dataset-csv.R b/r/tests/testthat/test-dataset-csv.R index e38dd17c62872..8c0f053e32497 100644 --- a/r/tests/testthat/test-dataset-csv.R +++ b/r/tests/testthat/test-dataset-csv.R @@ -595,20 +595,24 @@ test_that("CSVReadOptions field access", { }) 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( - int = int64(), dbl = int64(), lgl = bool(), chr = utf8(), - fct = utf8(), ts = timestamp(unit = "s"), part = int32() - ), + 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) expect_equal( ds %>%