Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion r/tests/testthat/test-dplyr-slice.R
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,12 @@ test_that("n <-> prop conversion when nrow is not known", {
)
})

# TODO: handle edge case where prop = 1, do nothing?
test_that("slice_sample with prop = 1 returns all data", {
# When prop = 1, no filtering should occur and all data should be returned
tab <- arrow_table(tbl)
result <- tab |>
slice_sample(prop = 1) |>
collect()
expect_equal(nrow(result), nrow(tbl))
expect_setequal(result$int, tbl$int)
})
Loading