You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by jo...@apache.org on 2023/01/05 17:02:27 UTC

[arrow] branch master updated: GH-15001: [R] Fix Parquet datatype test failure (#15197)

This is an automated email from the ASF dual-hosted git repository.

jonkeane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new d4a0c9e8be GH-15001: [R] Fix Parquet datatype test failure (#15197)
d4a0c9e8be is described below

commit d4a0c9e8be8f2730dd80be9934e27aa6bd4a0850
Author: Will Jones <wi...@gmail.com>
AuthorDate: Thu Jan 5 09:02:19 2023 -0800

    GH-15001: [R] Fix Parquet datatype test failure (#15197)
    
    
    * Closes: #15001
    
    Lead-authored-by: Will Jones <wi...@gmail.com>
    Co-authored-by: Jonathan Keane <jk...@gmail.com>
    Signed-off-by: Jonathan Keane <jk...@gmail.com>
---
 r/tests/testthat/test-parquet.R | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/r/tests/testthat/test-parquet.R b/r/tests/testthat/test-parquet.R
index 591805d4ff..be71d813bd 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
+  )
 })