Skip to content

Commit 200c8da

Browse files
authored
Changes for CRAN (#4)
* add logs folder to .Rbuildignore * update test connection * spelling * don't change working directory in test connection * fix typo in description * don't run tests on CRAN * remove jars dependencies * qualify sparkly function calls in test initialization * update description * add cran comments
1 parent 0d94129 commit 200c8da

File tree

8 files changed

+44
-22
lines changed

8 files changed

+44
-22
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
^configure\.win$
99
^configure\.R$
1010
^examples/
11+
^logs
1112
^demo\.R$
1213
^docs/
1314
^internal/
@@ -21,3 +22,4 @@
2122
^.classpath$
2223
^.project$
2324
^codecov\.yml$
25+
^cran-comments\.md$

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: graphframes
22
Type: Package
3-
Title: R interface for GraphFrames
3+
Title: R Interface for GraphFrames
44
Version: 0.1.0
55
Authors@R: person("Kevin", "Kuo", email = "kevin.kuo@rstudio.com", role = c("aut", "cre"))
66
Maintainer: Kevin Kuo <kevin.kuo@rstudio.com>
7-
Description: R interface for GraphFrames, a package for Apache Spark which provides
8-
DataFrame-based graphs, see <https://graphframes.github.io/>.
7+
Description: A sparklyr <https://spark.rstudio.com/> extension that provides an R
8+
interface for GraphFrames <https://graphframes.github.io/>.
99
License: Apache License 2.0 | file LICENSE
1010
Encoding: UTF-8
1111
LazyData: true

R/dependencies.R

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
spark_dependencies <- function(spark_version, scala_version, ...) {
22
spark_dependency(
3-
jars = c(
4-
system.file(
5-
sprintf("java/graphframes-%s-%s.jar", spark_version, scala_version),
6-
package = "graphframes"
7-
)
8-
),
3+
jars = NULL,
94
packages = c(
105
sprintf("graphframes:graphframes:0.5.0-spark%s-s_%s", spark_version, scala_version)
116
)

cran-comments.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Test environments
2+
* local OS X install, R 3.4.4
3+
* ubuntu 14.04 (on travis-ci), R 3.4.4
4+
* win-builder (devel)
5+
6+
## R CMD check results
7+
There were no ERRORs or WARNINGs.
8+
9+
There was 1 NOTE:
10+
11+
* New submission
12+
* Possibly mis-spelled words in DESCRIPTION:
13+
GraphFrames (3:24, 8:17)
14+
sparklyr (7:16)
15+
16+
This is a new submission. Spelling is correct.

inst/java/graphframes-2.0-2.11.jar

-342 Bytes
Binary file not shown.

inst/java/graphframes-2.1-2.11.jar

-342 Bytes
Binary file not shown.

tests/testthat.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
library(testthat)
22
library(graphframes)
33

4-
test_check("graphframes")
4+
if (identical(Sys.getenv("NOT_CRAN"), "true")) {
5+
test_check("graphframes")
6+
on.exit({spark_disconnect_all()})
7+
}

tests/testthat/helper-initialize.R

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44

55
# helper functions from sparklyr tests
66
# https://github.com/rstudio/sparklyr/blob/master/tests/testthat/helper-initialize.R
7-
testthat_spark_connection <- function(version = NULL) {
7+
testthat_spark_connection <- function() {
8+
version <- Sys.getenv("SPARK_VERSION", unset = "2.1.0")
9+
10+
spark_installed <- sparklyr::spark_installed_versions()
11+
if (nrow(spark_installed[spark_installed$spark == version, ]) == 0) {
12+
options(sparkinstall.verbose = TRUE)
13+
sparklyr::spark_install(version)
14+
}
15+
16+
expect_gt(nrow(sparklyr::spark_installed_versions()), 0)
817

918
# generate connection if none yet exists
1019
connected <- FALSE
@@ -14,9 +23,14 @@ testthat_spark_connection <- function(version = NULL) {
1423
}
1524

1625
if (!connected) {
17-
version <- version %||% Sys.getenv("SPARK_VERSION", unset = "2.1.0")
18-
setwd(tempdir())
19-
sc <- sparklyr::spark_connect(master = "local", version = version)
26+
config <- sparklyr::spark_config()
27+
28+
options(sparklyr.sanitize.column.names.verbose = TRUE)
29+
options(sparklyr.verbose = TRUE)
30+
options(sparklyr.na.omit.verbose = TRUE)
31+
options(sparklyr.na.action.verbose = TRUE)
32+
33+
sc <- sparklyr::spark_connect(master = "local", version = version, config = config)
2034
assign(".testthat_spark_connection", sc, envir = .GlobalEnv)
2135
}
2236

@@ -52,11 +66,3 @@ test_requires <- function(...) {
5266

5367
invisible(TRUE)
5468
}
55-
56-
sc <- tryCatch(
57-
testthat_spark_connection(version = "2.0.0"),
58-
error = function(e) {
59-
sparklyr::spark_install(version = "2.0.0")
60-
testthat_spark_connection(version = "2.0.0")
61-
}
62-
)

0 commit comments

Comments
 (0)