diff --git a/r/tests/testthat/test-parquet.R b/r/tests/testthat/test-parquet.R index 591805d4ff5ec..be71d813bd405 100644 --- a/r/tests/testthat/test-parquet.R +++ b/r/tests/testthat/test-parquet.R @@ -453,12 +453,27 @@ test_that("deprecated int96 timestamp unit can be specified when reading Parquet }) test_that("Can read parquet with nested lists and maps", { - parquet_test_data <- test_path("../../../cpp/submodules/parquet-testing/data") + # Construct the path to the parquet-testing submodule. This will search: + # * $ARROW_SOURCE_HOME/cpp/submodules/parquet-testing/data + # * ../cpp/submodules/parquet-testing/data + # ARROW_SOURCE_HOME is set in many of our CI setups, so that will find the files + # the .. version should catch some (thought not all) ways of running tests locally + parquet_test_data <- file.path( + Sys.getenv("ARROW_SOURCE_HOME", test_path("..")), + "cpp", + "submodules", + "parquet-testing", + "data" + ) skip_if_not(dir.exists(parquet_test_data), "Parquet test data missing") pq <- read_parquet(paste0(parquet_test_data, "/nested_lists.snappy.parquet"), as_data_frame = FALSE) - expect_equal(pq$a$type, list_of(list_of(list_of(utf8())))) + expect_equal(pq$a$type, list_of(list_of(list_of(utf8()))), ignore_attr = TRUE) pq <- read_parquet(paste0(parquet_test_data, "/nested_maps.snappy.parquet"), as_data_frame = FALSE) - expect_equal(pq$a$type, map_of(utf8(), map_of(int32(), field("val", boolean(), nullable = FALSE)))) + expect_equal( + pq$a$type, + map_of(utf8(), map_of(int32(), field("val", boolean(), nullable = FALSE))), + ignore_attr = TRUE + ) })