thisisnic commented on a change in pull request #10269: URL: https://github.com/apache/arrow/pull/10269#discussion_r634139678
########## File path: r/tests/testthat/test-RecordBatch.R ########## @@ -415,14 +414,42 @@ test_that("record_batch() handles null type (ARROW-7064)", { expect_equivalent(batch$schema, schema(a = int32(), n = null())) }) -test_that("record_batch() scalar recycling", { - skip("Not implemented (ARROW-11705)") +test_that("record_batch() scalar recycling with vectors", { expect_data_frame( record_batch(a = 1:10, b = 5), tibble::tibble(a = 1:10, b = 5) ) }) +test_that("record_batch() scalar recycling with Scalars, Arrays, and ChunkedArrays", { + + expect_data_frame( + record_batch(a = Array$create(1:10), b = Scalar$create(5)), + tibble::tibble(a = 1:10, b = 5) + ) + + expect_data_frame( + record_batch(a = Array$create(1:10), b = Array$create(5)), + tibble::tibble(a = 1:10, b = 5) + ) + + expect_data_frame( + record_batch(a = Array$create(1:10), b = ChunkedArray$create(5)), + tibble::tibble(a = 1:10, b = 5) + ) + +}) + +test_that("record_batch() no recycling with tibbles", { Review comment: I had a think about this, and `tibble::tibble` does support tibble recycling, so if we're trying to allow similar behaviour, I think it makes sense to implement it here. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org