diff options
author | Sun Rui <rui.sun@intel.com> | 2016-04-19 19:57:03 -0700 |
---|---|---|
committer | Shivaram Venkataraman <shivaram@cs.berkeley.edu> | 2016-04-19 19:57:03 -0700 |
commit | 8eedf0b553180d0e958b0fb49bc2fee81658495c (patch) | |
tree | 952d6c445d3f96d45c523674a76c4d6fe1534445 /R/pkg/inst/tests | |
parent | 4514aebd1e807a665c270bfdc3f1127b3a1da898 (diff) | |
download | spark-8eedf0b553180d0e958b0fb49bc2fee81658495c.tar.gz spark-8eedf0b553180d0e958b0fb49bc2fee81658495c.tar.bz2 spark-8eedf0b553180d0e958b0fb49bc2fee81658495c.zip |
[SPARK-13905][SPARKR] Change signature of as.data.frame() to be consistent with the R base package.
## What changes were proposed in this pull request?
Change the signature of as.data.frame() to be consistent with that in the R base package to meet R user's convention.
## How was this patch tested?
dev/lint-r
SparkR unit tests
Author: Sun Rui <rui.sun@intel.com>
Closes #11811 from sun-rui/SPARK-13905.
Diffstat (limited to 'R/pkg/inst/tests')
-rw-r--r-- | R/pkg/inst/tests/testthat/test_context.R | 2 | ||||
-rw-r--r-- | R/pkg/inst/tests/testthat/test_sparkSQL.R | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/R/pkg/inst/tests/testthat/test_context.R b/R/pkg/inst/tests/testthat/test_context.R index 6e06c974c2..9f51161230 100644 --- a/R/pkg/inst/tests/testthat/test_context.R +++ b/R/pkg/inst/tests/testthat/test_context.R @@ -26,7 +26,7 @@ test_that("Check masked functions", { maskedBySparkR <- masked[funcSparkROrEmpty] namesOfMasked <- c("describe", "cov", "filter", "lag", "na.omit", "predict", "sd", "var", "colnames", "colnames<-", "intersect", "rank", "rbind", "sample", "subset", - "summary", "transform", "drop", "window") + "summary", "transform", "drop", "window", "as.data.frame") expect_equal(length(maskedBySparkR), length(namesOfMasked)) expect_equal(sort(maskedBySparkR), sort(namesOfMasked)) # above are those reported as masked when `library(SparkR)` diff --git a/R/pkg/inst/tests/testthat/test_sparkSQL.R b/R/pkg/inst/tests/testthat/test_sparkSQL.R index d747d4f83f..2f65484fcb 100644 --- a/R/pkg/inst/tests/testthat/test_sparkSQL.R +++ b/R/pkg/inst/tests/testthat/test_sparkSQL.R @@ -1863,6 +1863,9 @@ test_that("Method as.data.frame as a synonym for collect()", { expect_equal(as.data.frame(irisDF), collect(irisDF)) irisDF2 <- irisDF[irisDF$Species == "setosa", ] expect_equal(as.data.frame(irisDF2), collect(irisDF2)) + + # Make sure as.data.frame in the R base package is not covered + expect_that(as.data.frame(c(1, 2)), not(throws_error())) }) test_that("attach() on a DataFrame", { |