From 3a5e0ab86c31e6863c8ddcc9418d8356b880e76e Mon Sep 17 00:00:00 2001 From: Yu ISHIKAWA Date: Tue, 21 Jul 2015 16:28:12 +0900 Subject: [PATCH] [SPARK-9121][SparkR] Get rid of the warnings about `no visible global function definition` in SparkR --- R/pkg/inst/tests/test_sparkSQL.R | 8 ++++---- dev/lint-r.R | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/R/pkg/inst/tests/test_sparkSQL.R b/R/pkg/inst/tests/test_sparkSQL.R index a3039d36c9402..202190389e613 100644 --- a/R/pkg/inst/tests/test_sparkSQL.R +++ b/R/pkg/inst/tests/test_sparkSQL.R @@ -21,10 +21,10 @@ context("SparkSQL functions") # Utility function for easily checking the values of a StructField checkStructField <- function(actual, expectedName, expectedType, expectedNullable) { - expect_equal(class(actual), "structField") - expect_equal(actual$name(), expectedName) - expect_equal(actual$dataType.toString(), expectedType) - expect_equal(actual$nullable(), expectedNullable) + testthat::expect_equal(class(actual), "structField") + testthat::expect_equal(actual$name(), expectedName) + testthat::expect_equal(actual$dataType.toString(), expectedType) + testthat::expect_equal(actual$nullable(), expectedNullable) } # Tests for SparkSQL functions in SparkR diff --git a/dev/lint-r.R b/dev/lint-r.R index dcb1a184291e1..85cfd0bf55997 100644 --- a/dev/lint-r.R +++ b/dev/lint-r.R @@ -25,5 +25,6 @@ library(lintr) argv <- commandArgs(TRUE) SPARK_ROOT_DIR <- as.character(argv[1]) +library(SparkR, lib.loc = file.path(SPARK_ROOT_DIR, "R", "lib")) path.to.package <- file.path(SPARK_ROOT_DIR, "R", "pkg") lint_package(path.to.package, cache = FALSE)