From 4d0438e72fd10faf9cde4c924680d79ba5467a9b Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 3 Jun 2024 22:57:45 +0000 Subject: [PATCH 1/6] feat!: rename with a function instead of rename_with --- R/dataframe__frame.R | 24 ++------- R/lazyframe__lazy.R | 66 +++++++++---------------- man/DataFrame_rename.Rd | 15 +++--- man/DataFrame_rename_with.Rd | 39 --------------- man/LazyFrame_rename.Rd | 15 +++--- man/LazyFrame_rename_with.Rd | 39 --------------- tests/testthat/_snaps/after-wrappers.md | 49 +++++++++--------- tests/testthat/test-dataframe.R | 6 +-- tests/testthat/test-lazy.R | 6 +-- 9 files changed, 72 insertions(+), 187 deletions(-) delete mode 100644 man/DataFrame_rename_with.Rd delete mode 100644 man/LazyFrame_rename_with.Rd diff --git a/R/dataframe__frame.R b/R/dataframe__frame.R index fa2a079d2..a0994a8b8 100644 --- a/R/dataframe__frame.R +++ b/R/dataframe__frame.R @@ -1595,8 +1595,6 @@ DataFrame_pivot = function( #' Rename column names of a DataFrame #' @inherit pl_DataFrame return #' @inherit LazyFrame_rename params details -#' @seealso -#' - [`$rename_with()`][DataFrame_rename_with] #' @examples #' df = pl$DataFrame( #' foo = 1:3, @@ -1605,30 +1603,14 @@ DataFrame_pivot = function( #' ) #' #' df$rename(apple = "foo") -DataFrame_rename = function(...) { - self$lazy()$rename(...)$collect() -} - -#' Rename column names of a DataFrame with a function -#' @inherit pl_DataFrame return -#' @inherit LazyFrame_rename_with description params details -#' @seealso -#' - [`$rename()`][DataFrame_rename] -#' @examples -#' df = pl$DataFrame( -#' foo = 1:3, -#' bar = 6:8, -#' ham = letters[1:3] -#' ) #' -#' df$rename_with( +#' df$rename( #' \(column_name) paste0("c", substr(column_name, 2, 100)) #' ) -DataFrame_rename_with = function(fun) { - self$lazy()$rename_with(fun)$collect() +DataFrame_rename = function(...) { + self$lazy()$rename(...)$collect() } - #' @title Summary statistics for a DataFrame #' #' @description This returns the total number of rows, the number of missing diff --git a/R/lazyframe__lazy.R b/R/lazyframe__lazy.R index ca0f78cd6..38ad73e5e 100644 --- a/R/lazyframe__lazy.R +++ b/R/lazyframe__lazy.R @@ -1540,10 +1540,10 @@ LazyFrame_melt = function( #' polars will block projection and predicate pushdowns at this node. #' @inherit pl_LazyFrame return #' @param ... One of the following: -#' - params like `new_name = "old_name"` to rename selected variables. -#' - as above but with params wrapped in a list -#' @seealso -#' - [`$rename_with()`][LazyFrame_rename_with] +#' - Params like `new_name = "old_name"` to rename selected variables. +#' - As above but with params wrapped in a list +#' - An R function that takes the old names character vector as input and +#' returns the new names character vector. #' @examples #' lf = pl$LazyFrame( #' foo = 1:3, @@ -1552,54 +1552,34 @@ LazyFrame_melt = function( #' ) #' #' lf$rename(apple = "foo")$collect() +#' +#' lf$rename( +#' \(column_name) paste0("c", substr(column_name, 2, 100)) +#' )$collect() LazyFrame_rename = function(...) { + uw = \(res) unwrap(res, "in $rename():") + mapping = list2(...) if (length(mapping) == 0) { return(self) + } else if (is.function(mapping[[1L]])) { + { + existing = names(self) + new = mapping[[1L]](existing) + } |> + result() |> + uw() + } else { + if (is.list(mapping[[1L]])) { + mapping = mapping[[1L]] + } + existing = unname(unlist(mapping)) + new = names(mapping) } - if (is.list(mapping[[1L]])) { - mapping = mapping[[1L]] - } - existing = unname(unlist(mapping)) - new = names(mapping) - unwrap(.pr$LazyFrame$rename(self, existing, new), "in $rename():") -} - - -#' Rename column names of a LazyFrame with a function -#' -#' This method is currently experimental and may -#' change without it being considered a breaking change. -#' @inherit LazyFrame_rename details return -#' @param fun An R function that takes the old names character vector as input and -#' returns the new names character vector. -#' @seealso -#' - [`$rename()`][LazyFrame_rename] -#' @examples -#' lf = pl$LazyFrame( -#' foo = 1:3, -#' bar = 6:8, -#' ham = letters[1:3] -#' ) -#' -#' lf$rename_with( -#' \(column_name) paste0("c", substr(column_name, 2, 100)) -#' )$collect() -LazyFrame_rename_with = function(fun) { - uw = \(res) unwrap(res, "in $rename_with():") - - { - existing = names(self) - new = fun(existing) - } |> - result() |> - uw() - .pr$LazyFrame$rename(self, existing, new) |> uw() } - #' Fetch `n` rows of a LazyFrame #' #' This is similar to `$collect()` but limit the number of rows to collect. It diff --git a/man/DataFrame_rename.Rd b/man/DataFrame_rename.Rd index 00d08939e..2174c6d53 100644 --- a/man/DataFrame_rename.Rd +++ b/man/DataFrame_rename.Rd @@ -9,8 +9,10 @@ DataFrame_rename(...) \arguments{ \item{...}{One of the following: \itemize{ -\item params like \code{new_name = "old_name"} to rename selected variables. -\item as above but with params wrapped in a list +\item Params like \code{new_name = "old_name"} to rename selected variables. +\item As above but with params wrapped in a list +\item An R function that takes the old names character vector as input and +returns the new names character vector. }} } \value{ @@ -31,9 +33,8 @@ df = pl$DataFrame( ) df$rename(apple = "foo") -} -\seealso{ -\itemize{ -\item \code{\link[=DataFrame_rename_with]{$rename_with()}} -} + +df$rename( + \(column_name) paste0("c", substr(column_name, 2, 100)) +) } diff --git a/man/DataFrame_rename_with.Rd b/man/DataFrame_rename_with.Rd deleted file mode 100644 index 26ad3860e..000000000 --- a/man/DataFrame_rename_with.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/dataframe__frame.R -\name{DataFrame_rename_with} -\alias{DataFrame_rename_with} -\title{Rename column names of a DataFrame with a function} -\usage{ -DataFrame_rename_with(fun) -} -\arguments{ -\item{fun}{An R function that takes the old names character vector as input and -returns the new names character vector.} -} -\value{ -\link[=DataFrame_class]{DataFrame} -} -\description{ -This method is currently experimental and may -change without it being considered a breaking change. -} -\details{ -If existing names are swapped (e.g. \code{A} points to \code{B} and \code{B} points to \code{A}), -polars will block projection and predicate pushdowns at this node. -} -\examples{ -df = pl$DataFrame( - foo = 1:3, - bar = 6:8, - ham = letters[1:3] -) - -df$rename_with( - \(column_name) paste0("c", substr(column_name, 2, 100)) -) -} -\seealso{ -\itemize{ -\item \code{\link[=DataFrame_rename]{$rename()}} -} -} diff --git a/man/LazyFrame_rename.Rd b/man/LazyFrame_rename.Rd index b56b38966..2932a77c3 100644 --- a/man/LazyFrame_rename.Rd +++ b/man/LazyFrame_rename.Rd @@ -9,8 +9,10 @@ LazyFrame_rename(...) \arguments{ \item{...}{One of the following: \itemize{ -\item params like \code{new_name = "old_name"} to rename selected variables. -\item as above but with params wrapped in a list +\item Params like \code{new_name = "old_name"} to rename selected variables. +\item As above but with params wrapped in a list +\item An R function that takes the old names character vector as input and +returns the new names character vector. }} } \value{ @@ -31,9 +33,8 @@ lf = pl$LazyFrame( ) lf$rename(apple = "foo")$collect() -} -\seealso{ -\itemize{ -\item \code{\link[=LazyFrame_rename_with]{$rename_with()}} -} + +lf$rename( + \(column_name) paste0("c", substr(column_name, 2, 100)) +)$collect() } diff --git a/man/LazyFrame_rename_with.Rd b/man/LazyFrame_rename_with.Rd deleted file mode 100644 index 0a05e2226..000000000 --- a/man/LazyFrame_rename_with.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/lazyframe__lazy.R -\name{LazyFrame_rename_with} -\alias{LazyFrame_rename_with} -\title{Rename column names of a LazyFrame with a function} -\usage{ -LazyFrame_rename_with(fun) -} -\arguments{ -\item{fun}{An R function that takes the old names character vector as input and -returns the new names character vector.} -} -\value{ -\link[=LazyFrame_class]{LazyFrame} -} -\description{ -This method is currently experimental and may -change without it being considered a breaking change. -} -\details{ -If existing names are swapped (e.g. \code{A} points to \code{B} and \code{B} points to \code{A}), -polars will block projection and predicate pushdowns at this node. -} -\examples{ -lf = pl$LazyFrame( - foo = 1:3, - bar = 6:8, - ham = letters[1:3] -) - -lf$rename_with( - \(column_name) paste0("c", substr(column_name, 2, 100)) -)$collect() -} -\seealso{ -\itemize{ -\item \code{\link[=LazyFrame_rename]{$rename()}} -} -} diff --git a/tests/testthat/_snaps/after-wrappers.md b/tests/testthat/_snaps/after-wrappers.md index 6dac0553b..e6ca0d1a8 100644 --- a/tests/testthat/_snaps/after-wrappers.md +++ b/tests/testthat/_snaps/after-wrappers.md @@ -87,16 +87,15 @@ [29] "lazy" "limit" "max" "mean" [33] "median" "melt" "min" "n_chunks" [37] "null_count" "partition_by" "pivot" "print" - [41] "quantile" "rechunk" "rename" "rename_with" - [45] "reverse" "rolling" "sample" "schema" - [49] "select" "select_seq" "shape" "shift" - [53] "shift_and_fill" "slice" "sort" "sql" - [57] "std" "sum" "tail" "to_data_frame" - [61] "to_list" "to_raw_ipc" "to_series" "to_struct" - [65] "transpose" "unique" "unnest" "var" - [69] "width" "with_columns" "with_columns_seq" "with_row_index" - [73] "write_csv" "write_ipc" "write_json" "write_ndjson" - [77] "write_parquet" + [41] "quantile" "rechunk" "rename" "reverse" + [45] "rolling" "sample" "schema" "select" + [49] "select_seq" "shape" "shift" "shift_and_fill" + [53] "slice" "sort" "sql" "std" + [57] "sum" "tail" "to_data_frame" "to_list" + [61] "to_raw_ipc" "to_series" "to_struct" "transpose" + [65] "unique" "unnest" "var" "width" + [69] "with_columns" "with_columns_seq" "with_row_index" "write_csv" + [73] "write_ipc" "write_json" "write_ndjson" "write_parquet" --- @@ -160,21 +159,21 @@ [27] "median" "melt" [29] "min" "print" [31] "profile" "quantile" - [33] "rename" "rename_with" - [35] "reverse" "rolling" - [37] "schema" "select" - [39] "select_seq" "serialize" - [41] "set_optimization_toggle" "shift" - [43] "shift_and_fill" "sink_csv" - [45] "sink_ipc" "sink_ndjson" - [47] "sink_parquet" "slice" - [49] "sort" "sql" - [51] "std" "sum" - [53] "tail" "to_dot" - [55] "unique" "unnest" - [57] "var" "width" - [59] "with_columns" "with_columns_seq" - [61] "with_context" "with_row_index" + [33] "rename" "reverse" + [35] "rolling" "schema" + [37] "select" "select_seq" + [39] "serialize" "set_optimization_toggle" + [41] "shift" "shift_and_fill" + [43] "sink_csv" "sink_ipc" + [45] "sink_ndjson" "sink_parquet" + [47] "slice" "sort" + [49] "sql" "std" + [51] "sum" "tail" + [53] "to_dot" "unique" + [55] "unnest" "var" + [57] "width" "with_columns" + [59] "with_columns_seq" "with_context" + [61] "with_row_index" --- diff --git a/tests/testthat/test-dataframe.R b/tests/testthat/test-dataframe.R index 545e21ac0..0decb8146 100644 --- a/tests/testthat/test-dataframe.R +++ b/tests/testthat/test-dataframe.R @@ -1080,7 +1080,7 @@ test_that("rename", { }) -test_that("rename_with", { +test_that("rename with a function", { df = pl$DataFrame( foo = 1:3, bar = 6:8, @@ -1088,14 +1088,14 @@ test_that("rename_with", { ) expect_identical( - df$rename_with( + df$rename( \(column_name) paste0("c", substr(column_name, 2, 100)) ) |> names(), c("coo", "car", "cam") ) - expect_grepl_error(df$rename_with(\(x) 1)) + expect_grepl_error(df$rename(\(x) 1)) }) diff --git a/tests/testthat/test-lazy.R b/tests/testthat/test-lazy.R index 85a5f80c2..4026bf30f 100644 --- a/tests/testthat/test-lazy.R +++ b/tests/testthat/test-lazy.R @@ -600,7 +600,7 @@ test_that("rename", { }) -test_that("rename_with", { +test_that("rename with a function", { lf = pl$DataFrame( foo = 1:3, bar = 6:8, @@ -608,14 +608,14 @@ test_that("rename_with", { )$lazy() expect_identical( - lf$rename_with( + lf$rename( \(column_name) paste0("c", substr(column_name, 2, 100)) ) |> names(), c("coo", "car", "cam") ) - expect_grepl_error(lf$rename_with(\(x) 1)) + expect_grepl_error(lf$rename(\(x) 1)) }) From 2de7d9fbddcbc0efd9c541f882146b4e261a95e7 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 3 Jun 2024 22:57:45 +0000 Subject: [PATCH 2/6] refactor!: swap names and values in `$rename()` --- R/dataframe__frame.R | 2 +- R/lazyframe__lazy.R | 8 ++++---- man/DataFrame_rename.Rd | 4 ++-- man/LazyFrame_rename.Rd | 4 ++-- tests/testthat/test-dataframe.R | 4 ++-- tests/testthat/test-lazy.R | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/R/dataframe__frame.R b/R/dataframe__frame.R index a0994a8b8..4f63e17c5 100644 --- a/R/dataframe__frame.R +++ b/R/dataframe__frame.R @@ -1602,7 +1602,7 @@ DataFrame_pivot = function( #' ham = letters[1:3] #' ) #' -#' df$rename(apple = "foo") +#' df$rename(foo = "apple") #' #' df$rename( #' \(column_name) paste0("c", substr(column_name, 2, 100)) diff --git a/R/lazyframe__lazy.R b/R/lazyframe__lazy.R index 38ad73e5e..782c688c7 100644 --- a/R/lazyframe__lazy.R +++ b/R/lazyframe__lazy.R @@ -1540,7 +1540,7 @@ LazyFrame_melt = function( #' polars will block projection and predicate pushdowns at this node. #' @inherit pl_LazyFrame return #' @param ... One of the following: -#' - Params like `new_name = "old_name"` to rename selected variables. +#' - Key value pairs that map from old name to new name, like `old_name = "new_name"`. #' - As above but with params wrapped in a list #' - An R function that takes the old names character vector as input and #' returns the new names character vector. @@ -1551,7 +1551,7 @@ LazyFrame_melt = function( #' ham = letters[1:3] #' ) #' -#' lf$rename(apple = "foo")$collect() +#' lf$rename(foo = "apple")$collect() #' #' lf$rename( #' \(column_name) paste0("c", substr(column_name, 2, 100)) @@ -1573,8 +1573,8 @@ LazyFrame_rename = function(...) { if (is.list(mapping[[1L]])) { mapping = mapping[[1L]] } - existing = unname(unlist(mapping)) - new = names(mapping) + new = unname(unlist(mapping)) + existing = names(mapping) } .pr$LazyFrame$rename(self, existing, new) |> uw() diff --git a/man/DataFrame_rename.Rd b/man/DataFrame_rename.Rd index 2174c6d53..854252280 100644 --- a/man/DataFrame_rename.Rd +++ b/man/DataFrame_rename.Rd @@ -9,7 +9,7 @@ DataFrame_rename(...) \arguments{ \item{...}{One of the following: \itemize{ -\item Params like \code{new_name = "old_name"} to rename selected variables. +\item Key value pairs that map from old name to new name, like \code{old_name = "new_name"}. \item As above but with params wrapped in a list \item An R function that takes the old names character vector as input and returns the new names character vector. @@ -32,7 +32,7 @@ df = pl$DataFrame( ham = letters[1:3] ) -df$rename(apple = "foo") +df$rename(foo = "apple") df$rename( \(column_name) paste0("c", substr(column_name, 2, 100)) diff --git a/man/LazyFrame_rename.Rd b/man/LazyFrame_rename.Rd index 2932a77c3..1baafffd0 100644 --- a/man/LazyFrame_rename.Rd +++ b/man/LazyFrame_rename.Rd @@ -9,7 +9,7 @@ LazyFrame_rename(...) \arguments{ \item{...}{One of the following: \itemize{ -\item Params like \code{new_name = "old_name"} to rename selected variables. +\item Key value pairs that map from old name to new name, like \code{old_name = "new_name"}. \item As above but with params wrapped in a list \item An R function that takes the old names character vector as input and returns the new names character vector. @@ -32,7 +32,7 @@ lf = pl$LazyFrame( ham = letters[1:3] ) -lf$rename(apple = "foo")$collect() +lf$rename(foo = "apple")$collect() lf$rename( \(column_name) paste0("c", substr(column_name, 2, 100)) diff --git a/tests/testthat/test-dataframe.R b/tests/testthat/test-dataframe.R index 0decb8146..707d812db 100644 --- a/tests/testthat/test-dataframe.R +++ b/tests/testthat/test-dataframe.R @@ -1062,7 +1062,7 @@ test_that("rename", { df = pl$DataFrame(mtcars) # renaming succeeded - a = df$rename(miles_per_gallon = "mpg", horsepower = "hp")$columns + a = df$rename(mpg = "miles_per_gallon", hp = "horsepower")$columns expect_false("hp" %in% a) expect_false("mpg" %in% a) expect_true("miles_per_gallon" %in% a) @@ -1075,7 +1075,7 @@ test_that("rename", { ) # wrapped args in list is equivalent - b = df$rename(list(miles_per_gallon = "mpg", horsepower = "hp"))$columns + b = df$rename(list(mpg = "miles_per_gallon", hp = "horsepower"))$columns expect_identical(a, b) }) diff --git a/tests/testthat/test-lazy.R b/tests/testthat/test-lazy.R index 4026bf30f..68127e2c7 100644 --- a/tests/testthat/test-lazy.R +++ b/tests/testthat/test-lazy.R @@ -582,7 +582,7 @@ test_that("rename", { lf = pl$DataFrame(mtcars)$lazy() # renaming succeeded - a = lf$rename(miles_per_gallon = "mpg", horsepower = "hp")$collect()$columns + a = lf$rename(mpg = "miles_per_gallon", hp = "horsepower")$collect()$columns expect_false("hp" %in% a) expect_false("mpg" %in% a) expect_true("miles_per_gallon" %in% a) @@ -595,7 +595,7 @@ test_that("rename", { ) # wrapped args in list is equivalent - b = lf$rename(list(miles_per_gallon = "mpg", horsepower = "hp"))$collect()$columns + b = lf$rename(list(mpg = "miles_per_gallon", hp = "horsepower"))$collect()$columns expect_identical(a, b) }) From f271b89d38f87f0502cc55f648939ca33b3e2c90 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 3 Jun 2024 22:58:52 +0000 Subject: [PATCH 3/6] docs(news): update news --- NEWS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 614c5507b..0883ea113 100644 --- a/NEWS.md +++ b/NEWS.md @@ -52,14 +52,16 @@ `time_unit` (#1116). - The default value of the `rechunk` argument of `pl$concat()` is changed from `TRUE` to `FALSE` (#1125). +- In `$rename()` for LazyFrame and DataFrame, key-value pairs of names are changed to + `old_name = "new_name"` instead of `new_name = "old_name"` (#1129). - In all `$rolling_*()` functions, the arguments `center` and `ddof` must be named (#1115). ### New features -- Experimental feature `$rename_with()` for LazyFrame and DataFrame. +- Allow specify a function in `$rename()` for LazyFrame and DataFrame. They are equivalent to `polars.LazyFrame.rename(mapping: Callable[[str], str])` - or `polars.DataFrame.rename(mapping: Callable[[str], str])` in Python Polars (#1122). + or `polars.DataFrame.rename(mapping: Callable[[str], str])` in Python Polars (#1122, #1129). ## Polars R Package 0.16.4 From d477c2bd238fa54ddb6134cb194d5b9c9b0465ea Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 3 Jun 2024 23:18:09 +0000 Subject: [PATCH 4/6] refactor: should not allow empty dots --- R/lazyframe__lazy.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/lazyframe__lazy.R b/R/lazyframe__lazy.R index 782c688c7..4a5cf474b 100644 --- a/R/lazyframe__lazy.R +++ b/R/lazyframe__lazy.R @@ -1559,15 +1559,17 @@ LazyFrame_melt = function( LazyFrame_rename = function(...) { uw = \(res) unwrap(res, "in $rename():") + if (!nargs()) { + Err_plain("No arguments provided for `$rename()`.") |> + uw() + } + mapping = list2(...) - if (length(mapping) == 0) { - return(self) - } else if (is.function(mapping[[1L]])) { - { + if (is.function(mapping[[1L]])) { + result({ existing = names(self) new = mapping[[1L]](existing) - } |> - result() |> + }) |> uw() } else { if (is.list(mapping[[1L]])) { From 055fe022ae19b32b886ab6fec45669dead7db851 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Tue, 4 Jun 2024 02:37:43 +0000 Subject: [PATCH 5/6] test: empty dots no longer allowed --- tests/testthat/test-dataframe.R | 8 ++++---- tests/testthat/test-lazy.R | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/testthat/test-dataframe.R b/tests/testthat/test-dataframe.R index 707d812db..b42dc77f5 100644 --- a/tests/testthat/test-dataframe.R +++ b/tests/testthat/test-dataframe.R @@ -1068,10 +1068,10 @@ test_that("rename", { expect_true("miles_per_gallon" %in% a) expect_true("horsepower" %in% a) - # no args are allowed, but does nothing - expect_identical( - df$rename()$to_list(), - df$to_list() + # no args are not allowed + expect_grepl_error( + df$rename(), + "No arguments provided" ) # wrapped args in list is equivalent diff --git a/tests/testthat/test-lazy.R b/tests/testthat/test-lazy.R index 68127e2c7..03192fcd1 100644 --- a/tests/testthat/test-lazy.R +++ b/tests/testthat/test-lazy.R @@ -588,10 +588,10 @@ test_that("rename", { expect_true("miles_per_gallon" %in% a) expect_true("horsepower" %in% a) - # no args are allowed, but does nothing - expect_identical( - lf$rename()$collect()$to_list(), - lf$collect()$to_list() + # no args are not allowed + expect_grepl_error( + lf$rename(), + "No arguments provided" ) # wrapped args in list is equivalent From 4d7075b0d2b17bf9b15278fe1e173258f14097ea Mon Sep 17 00:00:00 2001 From: eitsupi Date: Tue, 4 Jun 2024 02:41:28 +0000 Subject: [PATCH 6/6] docs(news): add the bullet --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 0883ea113..d02d923fa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -54,6 +54,7 @@ `TRUE` to `FALSE` (#1125). - In `$rename()` for LazyFrame and DataFrame, key-value pairs of names are changed to `old_name = "new_name"` instead of `new_name = "old_name"` (#1129). +- In `$rename()` for LazyFrame and DataFrame, no argument is not allowed (#1129). - In all `$rolling_*()` functions, the arguments `center` and `ddof` must be named (#1115).