From 676b2dd3a7eae3a2b216925688cf858bec499887 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 16 Oct 2023 21:38:34 -0300 Subject: [PATCH] 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 Signed-off-by: Dewey Dunnington --- 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 d5bf3d9271349..13cffa1423767 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) ) ) })