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

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


The following commit(s) were added to refs/heads/main by this push:
     new b3b958e029 GH-38293: [R] Fix non-deterministic duckdb test (#38294)
b3b958e029 is described below

commit b3b958e029623d7bdf353b7a1c4238eb89dfbc17
Author: Dewey Dunnington <[email protected]>
AuthorDate: Mon Oct 16 21:38:34 2023 -0300

    GH-38293: [R] Fix non-deterministic duckdb test (#38294)
    
    ### Rationale for this change
    
    The test fail with the latest version of duckdb (0.9.1).
    
    ### What changes are included in this PR?
    
    The test was changed so that it did not depend on non-deterministic 
behaviour. We sort all of the other expectations involving a group_by to avoid 
this problem...we hadn't changed this one yet because it didn't fail in any 
previous version of duckdb.
    
    ### Are these changes tested?
    
    Yes
    
    ### Are there any user-facing changes?
    
    No
    * Closes: #38293
    
    Authored-by: Dewey Dunnington <[email protected]>
    Signed-off-by: Dewey Dunnington <[email protected]>
---
 r/tests/testthat/test-duckdb.R | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/r/tests/testthat/test-duckdb.R b/r/tests/testthat/test-duckdb.R
index d5bf3d9271..13cffa1423 100644
--- a/r/tests/testthat/test-duckdb.R
+++ b/r/tests/testthat/test-duckdb.R
@@ -248,11 +248,12 @@ test_that("to_duckdb with a table", {
         int_mean = mean(int, na.rm = TRUE),
         dbl_mean = mean(dbl, na.rm = TRUE)
       ) %>%
-      collect(),
+      collect() %>%
+      arrange(int_mean),
     tibble::tibble(
-      "int > 4" = c(FALSE, NA, TRUE),
-      int_mean = c(2, NA, 7.5),
-      dbl_mean = c(2.1, 4.1, 7.3)
+      "int > 4" = c(FALSE, TRUE, NA),
+      int_mean = c(2, 7.5, NA),
+      dbl_mean = c(2.1, 7.3, 4.1)
     )
   )
 })

Reply via email to