Skip to content

Commit

Permalink
write out dplyr_pre_1.0.0() helper (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch authored Mar 20, 2023
1 parent a0d9dc7 commit e646868
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 149 deletions.
120 changes: 0 additions & 120 deletions R/compat-dplyr-old.R

This file was deleted.

29 changes: 3 additions & 26 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,9 @@
s3_register("ggplot2::autoplot", "tune_results")
s3_register("rsample::.get_fingerprint", "tune_results")

if (dplyr_pre_1.0.0()) {
vctrs::s3_register("dplyr::mutate", "tune_results", method = mutate_tune_results)
vctrs::s3_register("dplyr::arrange", "tune_results", method = arrange_tune_results)
vctrs::s3_register("dplyr::filter", "tune_results", method = filter_tune_results)
vctrs::s3_register("dplyr::rename", "tune_results", method = rename_tune_results)
vctrs::s3_register("dplyr::select", "tune_results", method = select_tune_results)
vctrs::s3_register("dplyr::slice", "tune_results", method = slice_tune_results)

vctrs::s3_register("dplyr::mutate", "resample_results", method = mutate_resample_results)
vctrs::s3_register("dplyr::arrange", "resample_results", method = arrange_resample_results)
vctrs::s3_register("dplyr::filter", "resample_results", method = filter_resample_results)
vctrs::s3_register("dplyr::rename", "resample_results", method = rename_resample_results)
vctrs::s3_register("dplyr::select", "resample_results", method = select_resample_results)
vctrs::s3_register("dplyr::slice", "resample_results", method = slice_resample_results)

vctrs::s3_register("dplyr::mutate", "iteration_results", method = mutate_iteration_results)
vctrs::s3_register("dplyr::arrange", "iteration_results", method = arrange_iteration_results)
vctrs::s3_register("dplyr::filter", "iteration_results", method = filter_iteration_results)
vctrs::s3_register("dplyr::rename", "iteration_results", method = rename_iteration_results)
vctrs::s3_register("dplyr::select", "iteration_results", method = select_iteration_results)
vctrs::s3_register("dplyr::slice", "iteration_results", method = slice_iteration_results)
} else {
vctrs::s3_register("dplyr::dplyr_reconstruct", "tune_results", method = dplyr_reconstruct_tune_results)
vctrs::s3_register("dplyr::dplyr_reconstruct", "resample_results", method = dplyr_reconstruct_resample_results)
vctrs::s3_register("dplyr::dplyr_reconstruct", "iteration_results", method = dplyr_reconstruct_iteration_results)
}
vctrs::s3_register("dplyr::dplyr_reconstruct", "tune_results", method = dplyr_reconstruct_tune_results)
vctrs::s3_register("dplyr::dplyr_reconstruct", "resample_results", method = dplyr_reconstruct_resample_results)
vctrs::s3_register("dplyr::dplyr_reconstruct", "iteration_results", method = dplyr_reconstruct_iteration_results)
}

# nocov end
2 changes: 0 additions & 2 deletions tests/testthat/test-filter-parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ test_that("basic functionality", {
# ------------------------------------------------------------------------------

test_that("bad inputs", {
skip_if(tune:::dplyr_pre_1.0.0())

svm_reg_results <- readRDS(test_path("data", "svm_reg_results.rds"))

expect_snapshot(error = TRUE, {
Expand Down
1 change: 0 additions & 1 deletion tests/testthat/test-misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ test_that("accessor functions", {

test_that("accessor functions", {
skip_if(utils::packageVersion("dials") <= "0.0.7")
skip_if(tune:::dplyr_pre_1.0.0())

load(test_path("data", "test_objects.RData"))

Expand Down

0 comments on commit e646868

Please sign in to comment.