Skip to content

Commit 4cf99f0

Browse files
committed
add comment about what sparsevctrs.verbose_materialize does
1 parent a7ccbf4 commit 4cf99f0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/testthat/test-sparsevctrs.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
test_that("sparse tibble can be passed to `fit() - supported", {
22
skip_if_not_installed("xgboost")
3+
# Make materialization of sparse vectors throw an error
4+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
35
withr::local_options("sparsevctrs.verbose_materialize" = 3)
46

57
hotel_data <- sparse_hotel_rates(tibble = TRUE)
@@ -28,6 +30,8 @@ test_that("sparse tibble can be passed to `fit() - unsupported", {
2830

2931
test_that("sparse matrix can be passed to `fit() - supported", {
3032
skip_if_not_installed("xgboost")
33+
# Make materialization of sparse vectors throw an error
34+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
3135
withr::local_options("sparsevctrs.verbose_materialize" = 3)
3236

3337
hotel_data <- sparse_hotel_rates()
@@ -57,6 +61,8 @@ test_that("sparse matrix can be passed to `fit() - unsupported", {
5761

5862
test_that("sparse tibble can be passed to `fit_xy() - supported", {
5963
skip_if_not_installed("xgboost")
64+
# Make materialization of sparse vectors throw an error
65+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
6066
withr::local_options("sparsevctrs.verbose_materialize" = 3)
6167

6268
hotel_data <- sparse_hotel_rates(tibble = TRUE)
@@ -84,6 +90,8 @@ test_that("sparse tibble can be passed to `fit_xy() - unsupported", {
8490

8591
test_that("sparse matrices can be passed to `fit_xy() - supported", {
8692
skip_if_not_installed("xgboost")
93+
# Make materialization of sparse vectors throw an error
94+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
8795
withr::local_options("sparsevctrs.verbose_materialize" = 3)
8896

8997
hotel_data <- sparse_hotel_rates()
@@ -112,6 +120,8 @@ test_that("sparse matrices can be passed to `fit_xy() - unsupported", {
112120

113121
test_that("sparse tibble can be passed to `predict() - supported", {
114122
skip_if_not_installed("ranger")
123+
# Make materialization of sparse vectors throw an error
124+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
115125
withr::local_options("sparsevctrs.verbose_materialize" = 3)
116126

117127
hotel_data <- sparse_hotel_rates(tibble = TRUE)
@@ -147,6 +157,8 @@ test_that("sparse tibble can be passed to `predict() - unsupported", {
147157

148158
test_that("sparse matrices can be passed to `predict() - supported", {
149159
skip_if_not_installed("ranger")
160+
# Make materialization of sparse vectors throw an error
161+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
150162
withr::local_options("sparsevctrs.verbose_materialize" = 3)
151163

152164
hotel_data <- sparse_hotel_rates()
@@ -181,6 +193,8 @@ test_that("sparse matrices can be passed to `predict() - unsupported", {
181193

182194
test_that("sparse data work with xgboost engine", {
183195
skip_if_not_installed("xgboost")
196+
# Make materialization of sparse vectors throw an error
197+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
184198
withr::local_options("sparsevctrs.verbose_materialize" = 3)
185199

186200
spec <- boost_tree() %>%
@@ -219,6 +233,8 @@ test_that("sparse data work with xgboost engine", {
219233

220234
test_that("to_sparse_data_frame() is used correctly", {
221235
skip_if_not_installed("xgboost")
236+
# Make materialization of sparse vectors throw an error
237+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
222238
withr::local_options("sparsevctrs.verbose_materialize" = 3)
223239

224240
local_mocked_bindings(
@@ -260,6 +276,8 @@ test_that("to_sparse_data_frame() is used correctly", {
260276

261277
test_that("maybe_sparse_matrix() is used correctly", {
262278
skip_if_not_installed("xgboost")
279+
# Make materialization of sparse vectors throw an error
280+
# https://r-lib.github.io/sparsevctrs/dev/reference/sparsevctrs_options.html
263281
withr::local_options("sparsevctrs.verbose_materialize" = 3)
264282

265283
local_mocked_bindings(

0 commit comments

Comments
 (0)