Skip to content

Commit

Permalink
docs: forgot to remove completely inherit_optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Sep 28, 2024
1 parent ce4937a commit fe02afb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 46 deletions.
2 changes: 0 additions & 2 deletions R/sink.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
#' @param no_optimization Sets the following optimizations to `FALSE`:
#' `predicate_pushdown`, `projection_pushdown`, `slice_pushdown`,
#' `simplify_expression`. Default is `FALSE`.
#' @param inherit_optimization Use existing optimization settings regardless of
#' the settings specified in this function call. Default is `FALSE`.
#'
#' @return The input LazyFrame.
#' @export
Expand Down
3 changes: 0 additions & 3 deletions man/sink_parquet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 36 additions & 41 deletions tests/testthat/test-funs-string.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,47 +121,42 @@ test_that("str_trim() works", {
# )
# })

test_that("str_dup() works", {
for_all(
tests = 40,
string = character_(any_na = TRUE),
# Very high numbers crash the session, I guess because of stringr
times = numeric_bounded(-10000, 10000, any_na = TRUE),
property = function(string, times) {
test_df <- data.frame(x1 = string)
test <- pl$DataFrame(x1 = string)

# TODO: Counter example
# string = c(NA, NA, NA, NA, "VsF7|'x", "VsF7|'x", NA, "VsF7|'x")
# times = c(0, 0, 0, 0, NA, NA, NA, 0)
expect_equal_or_both_error(
mutate(test, foo = str_dup(x1, times = times)) |>
pull(foo),
mutate(test_df, foo = str_dup(x1, times = times)) |>
pull(foo)
)
}
)
})

# test_that("str_dup() works", {
# for_all(
# tests = 20,
# string = character_(any_na = TRUE),
# # Very high numbers crash the session, I guess because of stringr
# times = numeric_bounded(-10000, 10000, any_na = TRUE),
# property = function(string, times) {
# test_df <- data.frame(x1 = string)
# test <- pl$DataFrame(x1 = string)
#
# expect_equal_or_both_error(
# mutate(test, foo = str_dup(x1, times = times)) |>
# pull(foo),
# mutate(test_df, foo = str_dup(x1, times = times)) |>
# pull(foo)
# )
# }
# )
# })
test_that("str_sub() works", {
for_all(
tests = 40,
string = character_(any_na = TRUE),
start = numeric_(any_na = TRUE),
end = numeric_(any_na = TRUE),
property = function(string, start, end) {
test_df <- data.frame(x1 = string)
test <- pl$DataFrame(x1 = string)

# test_that("str_sub() works", {
# for_all(
# tests = 40,
# string = character_(any_na = TRUE),
# start = numeric_(any_na = TRUE),
# end = numeric_(any_na = TRUE),
# property = function(string, start, end) {
# test_df <- data.frame(x1 = string)
# test <- pl$DataFrame(x1 = string)
#
# expect_equal_or_both_error(
# mutate(test, foo = str_sub(x1, start, end)) |>
# pull(foo),
# mutate(test_df, foo = str_sub(x1, start, end)) |>
# pull(foo)
# )
# }
# )
# })
expect_equal_or_both_error(
mutate(test, foo = str_sub(x1, start, end)) |>
pull(foo),
mutate(test_df, foo = str_sub(x1, start, end)) |>
pull(foo)
)
}
)
})

0 comments on commit fe02afb

Please sign in to comment.