Skip to content

Commit

Permalink
Change the schema to non-default to see if getting retained
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisnic committed Sep 11, 2023
1 parent 45d4c86 commit 3552c8f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions r/tests/testthat/test-dataset-csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>%
Expand Down

0 comments on commit 3552c8f

Please sign in to comment.