Skip to content

Commit

Permalink
docs: remove broken $name$map's document (#1123)
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Jun 2, 2024
1 parent a57f490 commit ff8cdf3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 39 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
- The `check_sorted` argument is removed from `$rolling()` and `$group_by_dynamic()`.
Sortedness is now verified in a quick manner, so this argument is no longer needed
(pola-rs/polars#16494).
- `$name$map()` stacks on Linux, so this method is deprecated and the document
is removed. Please use other methods including `$rename_with()` instead (#1123).
- As warned in v0.16.0, the order of arguments in `pl$Series` is changed (#1071).
The first argument is now `name`, and the second argument is `values`.
- `$to_struct()` on an Expr is removed. This method is now only available for
Expand Down
22 changes: 12 additions & 10 deletions R/expr__name.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ ExprName_keep = function() {
unwrap("in $name$keep():")
}

# TODO: this method is broken after <https://github.com/pola-rs/r-polars/pull/1104>, so not documented
#' @noRd
#' Map alias of expression with an R function
#'
#' Rename the output of an expression by mapping a function over the root name.
Expand All @@ -57,16 +59,16 @@ ExprName_keep = function() {
#' @return Expr
#'
#' @examples
#' # df = pl$DataFrame(var1 = 1:3, var2 = "a")
#' #
#' # df$select(
#' # pl$col("*")$name$map(\(x) paste0("new_", x))
#' # )
#' #
#' # # $alias() is not taken into account by $name$map()
#' # df$select(
#' # pl$col("var1")$alias("foobar")$name$map(\(x) paste0("new_", x))
#' # )
#' df = pl$DataFrame(var1 = 1:3, var2 = "a")
#'
#' df$select(
#' pl$col("*")$name$map(\(x) paste0("new_", x))
#' )
#'
#' # $alias() is not taken into account by $name$map()
#' df$select(
#' pl$col("var1")$alias("foobar")$name$map(\(x) paste0("new_", x))
#' )
ExprName_map = function(fun) {
if (
!polars_options()$no_messages &&
Expand Down
29 changes: 0 additions & 29 deletions man/ExprName_map.Rd

This file was deleted.

0 comments on commit ff8cdf3

Please sign in to comment.