Skip to content

Commit

Permalink
Update sampleDF test
Browse files Browse the repository at this point in the history
  • Loading branch information
cafreeman committed Feb 28, 2015
1 parent 889c265 commit b0e7f73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/R/DataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ setMethod("sampleDF",
# TODO : Figure out how to send integer as java.lang.Long to JVM so
# we can send seed as an argument through callJMethod
signature(x = "DataFrame", withReplacement = "logical",
fraction = "numeric"),
fraction = "numeric"),
function(x, withReplacement, fraction) {
if (fraction < 0.0) stop(cat("Negative fraction value:", fraction))
sdf <- callJMethod(x@sdf, "sample", withReplacement, fraction)
Expand Down
2 changes: 2 additions & 0 deletions pkg/inst/tests/test_sparkSQL.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ test_that("sampleDF on a DataFrame", {
sampled <- sampleDF(df, FALSE, 1.0)
expect_equal(nrow(collect(sampled)), count(df))
expect_true(inherits(sampled, "DataFrame"))
sampled2 <- sampleDF(df, FALSE, 0.1)
expect_true(count(sampled2) < 3)
})

unlink(jsonPath)

0 comments on commit b0e7f73

Please sign in to comment.