paleolimbot commented on code in PR #826:
URL: https://github.com/apache/arrow-nanoarrow/pull/826#discussion_r2546872005


##########
r/tests/testthat/test-altrep.R:
##########
@@ -32,21 +32,29 @@ test_that("nanoarrow_altrep_chr() works for string", {
   expect_length(x_altrep, 27)
   expect_false(is_nanoarrow_altrep_materialized(x_altrep))
 
-  # Setting an element will materialize, duplicate, then modify
+  # Setting an element will materialize, duplicate, then modify in R <= 4.5
   x_altrep2 <- x_altrep
   x_altrep2[1] <- "not a letter"
   expect_identical(x_altrep2, c("not a letter", letters))
-  expect_true(is_nanoarrow_altrep_materialized(x_altrep))
 
-  # Check the same operations on the materialized output
+  # Materialization should get printed in inspect() if it occurred here (R <= 
4.5)
+  # On R-devel (2025-11-19), x_altrep2 becomes an independent copy here and
+  # the original is not materialized with our current implementation.
+  if (getRversion() <= "4.5.1") {
+    expect_true(is_nanoarrow_altrep_materialized(x_altrep))
+    expect_output(.Internal(inspect(x_altrep)), "<materialized 
nanoarrow::altrep_chr\\[27\\]>")
+  }

Review Comment:
   This is the crux of the fix



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