Skip to content

Commit 8852892

Browse files
committed
use is.numeric
1 parent e48bb22 commit 8852892

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

R/pkg/R/DataFrame.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,7 @@ setMethod("unpersist",
602602
setMethod("repartition",
603603
signature(x = "SparkDataFrame"),
604604
function(x, numPartitions = NULL, col = NULL, ...) {
605-
if (!is.null(numPartitions) && (class(numPartitions) == "numeric" ||
606-
class(numPartitions) == "integer")) {
605+
if (!is.null(numPartitions) && is.numeric(numPartitions)) {
607606
# number of partitions and columns both are specified
608607
if (!is.null(col) && class(col) == "Column") {
609608
cols <- list(col, ...)

R/pkg/R/RDD.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,8 +1025,7 @@ setMethod("keyBy",
10251025
setMethod("repartition",
10261026
signature(x = "RDD"),
10271027
function(x, numPartitions) {
1028-
if (!is.null(numPartitions) && (class(numPartitions) == "numeric" ||
1029-
class(numPartitions) == "integer")) {
1028+
if (!is.null(numPartitions) && is.numeric(numPartitions)) {
10301029
coalesce(x, numPartitions, TRUE)
10311030
} else {
10321031
coalesce(x, 200L, TRUE)

0 commit comments

Comments
 (0)