Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Nov 17, 2023
1 parent b7506af commit d13ac51
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions R/expr__string.R
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ ExprStr_zfill = function(alignment) {
#' df$select(pl$col("a")$str$pad_end(8, "*"))
ExprStr_pad_end = function(width, fillchar = " ") {
.pr$Expr$str_pad_end(self, width, fillchar) |>
unwrap("in str$ljust(): ")
unwrap("in str$pad_end(): ")
}


Expand All @@ -336,7 +336,7 @@ ExprStr_pad_end = function(width, fillchar = " ") {
#' df$select(pl$col("a")$str$pad_start(8, "*"))
ExprStr_pad_start = function(width, fillchar = " ") {
.pr$Expr$str_pad_start(self, width, fillchar) |>
unwrap("in str$rjust(): ")
unwrap("in str$pad_start(): ")
}


Expand Down
2 changes: 1 addition & 1 deletion R/extendr-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ Series$floor <- function() .Call(wrap__Series__floor, self)

Series$print <- function() invisible(.Call(wrap__Series__print, self))

Series$cumsum <- function(reverse) .Call(wrap__Series__cumsum, self, reverse)
Series$cum_sum <- function(reverse) .Call(wrap__Series__cum_sum, self, reverse)

Series$to_frame <- function() .Call(wrap__Series__to_frame, self)

Expand Down
8 changes: 4 additions & 4 deletions R/series__series.R
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,10 @@ Series_clone = "use_extendr_wrapper"
#' The Dtypes Int8, UInt8, Int16 and UInt16 are cast to
#' Int64 before summing to prevent overflow issues.
#' @examples
#' pl$Series(c(1:2, NA, 3, NaN, 4, Inf))$cumsum()
#' pl$Series(c(1:2, NA, 3, Inf, 4, -Inf, 5))$cumsum()
Series_cumsum = function(reverse = FALSE) {
.pr$Series$cumsum(self, reverse) |> unwrap("in $cumsum()")
#' pl$Series(c(1:2, NA, 3, NaN, 4, Inf))$cum_sum()
#' pl$Series(c(1:2, NA, 3, Inf, 4, -Inf, 5))$cum_sum()
Series_cum_sum = function(reverse = FALSE) {
.pr$Series$cum_sum(self, reverse) |> unwrap("in $cum_sum()")
}

#' Sum
Expand Down
7 changes: 4 additions & 3 deletions man/Series_cumsum.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-expr_string.R
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ test_that("zfill", {
})

# patrick package could be justified here
test_that("str$ljust str$rjust", {
test_that("str$pad_start str$pad_start", {
# ljust
df = pl$DataFrame(a = c("cow", "monkey", NA, "hippopotamus"))
expect_identical(
Expand Down

0 comments on commit d13ac51

Please sign in to comment.