Skip to content

Commit 4c7f410

Browse files
authored
DS-4923 Only check QTable class (#21)
1 parent f8a9ec6 commit 4c7f410

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

R/plotly.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ plot_ly <- function(data = data.frame(), ..., type = NULL, name,
142142
}
143143

144144
if (is.data.frame(data) && nrow(data) > 0L) {
145-
qtables <- vapply(data, inherits, logical(1L), c("qTable", "QTable"))
145+
qtables <- vapply(data, inherits, logical(1L), "QTable")
146146
if (any(qtables))
147147
data[qtables] <- lapply(data[qtables], as.vector)
148148
}

tests/testthat/test-plotly.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ test_that("Check QTables dont cause errors", {
365365
x2 = array(runif(n), dim = n),
366366
y = factor(letters[1:10])
367367
)
368-
class(s[[1]]) <- "QTable"
369-
class(s[[2]]) <- "qTable"
368+
class(s[[1]]) <- class(s[[2]]) <- "QTable"
370369
expect_error(p <- plot_ly(s) |>
371370
add_segments(x = ~x, xend = ~x2, y = ~y, yend = ~y, showlegend = FALSE) |>
372371
add_markers(x = ~x, xend = ~y, y = ~y, name = "foo", color = I("orange"), showlegend = FALSE) |>

0 commit comments

Comments
 (0)