Skip to content

Commit

Permalink
Merge branch 'main' into len-nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Apr 16, 2024
2 parents fb1f1de + aaefa67 commit 1a87e1f
Show file tree
Hide file tree
Showing 27 changed files with 280 additions and 192 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ trim_trailing_whitespace = true

[*.md]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: polars
Title: Lightning-Fast 'DataFrame' Library
Version: 0.15.1.9000
Version: 0.16.0.9000
Depends: R (>= 4.2)
Imports: utils, codetools, methods
Authors@R:
Expand Down
173 changes: 90 additions & 83 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# NEWS

## Polars R Package (development version)
## polars (development version)

## Polars R Package 0.16.0

### Breaking changes

- Rust polars is updated to 0.39.0 (#937, #1034).
- R objects inside an R list are now converted to Polars data types via
`as_polars_series()` (#1021, #1022, #1023). For example, up to polars 0.15.1,
a list containing a data.frame with a column of `{clock}` naive-time class
Expand Down Expand Up @@ -50,93 +53,97 @@

1. Change in argument names:

- In `$reshape()`, the `dims` argument is renamed to `dimensions` (#1019).
- In `pl$read_*` and `pl$scan_*` functions, the first argument is now
`source` (#935).
- In `pl$Series()`, the argument `x` is renamed `values` (#933).
- In `<DataFrame>$write_*` functions, the first argument is now `file` (#935).
- In `<LazyFrame>$sink_*` functions, the first argument is now `path` (#935).
- In `<LazyFrame>$sink_ipc()`, the argument `memmap` is renamed to `memory_map` (#1032).
- In `<DataFrame>$rolling()`, `<LazyFrame>$rolling()`, `<DataFrame>$group_by_dynamic()`
and `<LazyFrame>$group_by_dynamic()`, the `by` argument is renamed to
`group_by` (#983).
- In `$dt$convert_time_zone()` and `$dt$replace_time_zone()`, the `tz`
argument is renamed to `time_zone` (#944).
- In `$str$strptime()`, the argument `datatype` is renamed to `dtype` (#939).
- In `$str$parse_int()`, argument `radix` is renamed to `base` (#1034).
- In `$reshape()`, the `dims` argument is renamed to `dimensions` (#1019).
- In `pl$read_*` and `pl$scan_*` functions, the first argument is now
`source` (#935).
- In `pl$Series()`, the argument `x` is renamed `values` (#933).
- In `<DataFrame>$write_*` functions, the first argument is now `file` (#935).
- In `<LazyFrame>$sink_*` functions, the first argument is now `path` (#935).
- In `<LazyFrame>$sink_ipc()`, the argument `memmap` is renamed to `memory_map` (#1032).
- In `<DataFrame>$rolling()`, `<LazyFrame>$rolling()`, `<DataFrame>$group_by_dynamic()`
and `<LazyFrame>$group_by_dynamic()`, the `by` argument is renamed to
`group_by` (#983).
- In `$dt$convert_time_zone()` and `$dt$replace_time_zone()`, the `tz`
argument is renamed to `time_zone` (#944).
- In `$str$strptime()`, the argument `datatype` is renamed to `dtype` (#939).
- In `$str$to_integer()` (renamed from `$str$parse_int()`), argument `radix` is
renamed to `base` (#1038).

2. Change in the way arguments are passed:

- In all input/output functions, all arguments except the first argument
must be named arguments (#935).
- In `<DataFrame>$rolling()` and `<DataFrame>$group_by_dynamic()`, all
arguments except `index_column` must be named arguments (#983).
- In `$unique()` for `DataFrame` and `LazyFrame`, arguments `keep` and
`maintain_order` must be named (#953).
- In `$bin$decode()`, the `strict` argument must be a named argument (#980).
- In `$dt$replace_time_zone()`, all arguments except `time_zone` must be named
arguments (#944).
- In `$str$contains()`, the arguments `literal` and `strict` must be named
(#982).
- In `$str$contains_any()`, the `ascii_case_insensitive` argument must be
named (#986).
- In `$str$count_matches()`, `$str$replace()` and `$str$replace_all()`,
the `literal` argument must be named (#987).
- In `$str$strptime()`, `$str$to_date()`, `$str$to_datetime()`, and
`$str$to_time()`, all arguments (except the first one) must be named (#939).
- In `pl$date_range()`, the arguments `closed`, `time_unit`, and `time_zone`
must be named (#950).
- In `$set_sorted()` and `$sort_by()`, argument `descending` must be named
(#1034).
- In `pl$Series()`, using positional arguments throws a warning, since the
argument positions will be changed in the future (#966).

```r
# polars 0.15.1 or earlier
# The first argument is `x`, the second argument is `name`.
pl$Series(1:3, "foo")

# The code above will warn in 0.16.0
# Use named arguments to silence the warning.
pl$Series(values = 1:3, name = "foo")
pl$Series(name = "foo", values = 1:3)

# polars 0.17.0 or later (future version)
# The first argument is `name`, the second argument is `values`.
pl$Series("foo", 1:3)
```

This warning can also be silenced by replacing `pl$Series(<values>, <name>)`
by `as_polars_series(<values>, <name>)`.
- In all input/output functions, all arguments except the first argument
must be named arguments (#935).
- In `<DataFrame>$rolling()` and `<DataFrame>$group_by_dynamic()`, all
arguments except `index_column` must be named arguments (#983).
- In `$unique()` for `DataFrame` and `LazyFrame`, arguments `keep` and
`maintain_order` must be named (#953).
- In `$bin$decode()`, the `strict` argument must be a named argument (#980).
- In `$dt$replace_time_zone()`, all arguments except `time_zone` must be named
arguments (#944).
- In `$str$contains()`, the arguments `literal` and `strict` must be named
(#982).
- In `$str$contains_any()`, the `ascii_case_insensitive` argument must be
named (#986).
- In `$str$count_matches()`, `$str$replace()` and `$str$replace_all()`,
the `literal` argument must be named (#987).
- In `$str$strptime()`, `$str$to_date()`, `$str$to_datetime()`, and
`$str$to_time()`, all arguments (except the first one) must be named (#939).
- In `$str$to_integer()` (renamed from `$str$parse_int()`), all arguments
must be named (#1038).
- In `pl$date_range()`, the arguments `closed`, `time_unit`, and `time_zone`
must be named (#950).
- In `$set_sorted()` and `$sort_by()`, argument `descending` must be named
(#1034).
- In `pl$Series()`, using positional arguments throws a warning, since the
argument positions will be changed in the future (#966).

```r
# polars 0.15.1 or earlier
# The first argument is `x`, the second argument is `name`.
pl$Series(1:3, "foo")

# The code above will warn in 0.16.0
# Use named arguments to silence the warning.
pl$Series(values = 1:3, name = "foo")
pl$Series(name = "foo", values = 1:3)

# polars 0.17.0 or later (future version)
# The first argument is `name`, the second argument is `values`.
pl$Series("foo", 1:3)
```

This warning can also be silenced by replacing `pl$Series(<values>, <name>)`
by `as_polars_series(<values>, <name>)`.

3. Arguments removed:

- The argument `columns` in `$drop()` is removed. `$drop()` now accepts
several character scalars, such as `$drop("a", "b", "c")` (#912).
- In `pl$col()`, the `name` argument is removed, and the `...` argument no
longer accepts a list of characters and `RPolarsSeries` class objects (#923).
- In `pl$date_range()`, the unused argument (not working in recent versions)
`explode` is removed. (#950).
- The argument `columns` in `$drop()` is removed. `$drop()` now accepts
several character scalars, such as `$drop("a", "b", "c")` (#912).
- In `pl$col()`, the `name` argument is removed, and the `...` argument no
longer accepts a list of characters and `RPolarsSeries` class objects (#923).
- In `pl$date_range()`, the unused argument (not working in recent versions)
`explode` is removed. (#950).

4. Change in arguments default and accepted values:

- In `pl$Series()`, the argument `values` has a new default value `NULL`
(#966).
- In `$unique()` for `DataFrame` and `LazyFrame`, argument `keep` has a new
default value `"any"` (#953).
- In rolling aggregation functions (such as `$rolling_mean()`), the default
value of argument `closed` now is `NULL`. Using `closed` with a fixed
`window_size` now throws an error (#937).
- In `pl$date_range()`, the argument `end` must be specified and the default
value of `interval` is changed to `"1d"`. The arguments `start` and `end`
no longer accept numeric values (#950).
- In `pl$scan_parquet()`, the default value of the argument `rechunk` is
changed from `TRUE` to `FALSE` (#1033).
- In `pl$scan_parquet()` and `pl$read_parquet()`, the argument `parallel`
only accepts `"auto"`, `"columns"`, `"row_groups"`, and `"none"`.
Previously, it also accepted upper-case notation of `"auto"`, `"columns"`,
`"none"`, and `"RowGroups"` instead of `"row_groups"` (#1033).

- In `pl$Series()`, the argument `values` has a new default value `NULL`
(#966).
- In `$unique()` for `DataFrame` and `LazyFrame`, argument `keep` has a new
default value `"any"` (#953).
- In rolling aggregation functions (such as `$rolling_mean()`), the default
value of argument `closed` now is `NULL`. Using `closed` with a fixed
`window_size` now throws an error (#937).
- In `pl$date_range()`, the argument `end` must be specified and the default
value of `interval` is changed to `"1d"`. The arguments `start` and `end`
no longer accept numeric values (#950).
- In `pl$scan_parquet()`, the default value of the argument `rechunk` is
changed from `TRUE` to `FALSE` (#1033).
- In `pl$scan_parquet()` and `pl$read_parquet()`, the argument `parallel`
only accepts `"auto"`, `"columns"`, `"row_groups"`, and `"none"`.
Previously, it also accepted upper-case notation of `"auto"`, `"columns"`,
`"none"`, and `"RowGroups"` instead of `"row_groups"` (#1033).
- In `$str$to_integer()` (renamed from `$str$parse_int()`), the default
value of `base` is changed from `2` to `10` (#1038).

- The usage of `pl$date_range()` to create a range of `Datetime` data type is
deprecated. `pl$date_range()` will always create a range of `Date` data type
Expand All @@ -154,7 +161,7 @@
- The following deprecated functions are now removed: `pl$threadpool_size()`,
`<DataFrame>$with_row_count()`, `<LazyFrame>$with_row_count()` (#965).
- In `$group_by_dynamic()`, the first datapoint is always preserved (#1034).

- `$str$parse_int()` is renamed to `$str$to_integer()` (#1038).

### New features

Expand All @@ -167,8 +174,8 @@
- `pl$datetime_range()`, `pl$date_ranges()` and `pl$datetime_ranges()` (#950, #962).
- `pl$int_range()` and `pl$int_ranges()` (#968)
- `pl$mean_horizontal()` (#959)
- `is_polars_dtype()` (#927).
- `pl$read_ipc()` (#1033).
- `is_polars_dtype()` (#927).

- New methods:

Expand Down Expand Up @@ -204,8 +211,8 @@
more classes to Series properly (#1015).
- Export the `Duration` datatype (#955).
- New active binding `<Series>$struct$fields` (#1002).
- rust-polars is updated to 0.39.0 (#937, #1034).
- All `$write_*()` and `$sink_*()` functions now invisibly return the input
data (#1039).
### Bug fixes
Expand Down
13 changes: 6 additions & 7 deletions R/dataframe__frame.R
Original file line number Diff line number Diff line change
Expand Up @@ -1935,8 +1935,7 @@ DataFrame_transpose = function(
#' * `"never"`: This never puts quotes around fields, even if that results in
#' invalid CSV data (e.g. by not quoting strings containing the separator).
#'
#' @return
#' This doesn't return anything.
#' @return Invisibly returns the input DataFrame.
#'
#' @rdname IO_write_csv
#'
Expand Down Expand Up @@ -1970,7 +1969,7 @@ DataFrame_write_csv = function(
) |>
unwrap("in $write_csv():")

invisible(NULL)
invisible(self)
}


Expand Down Expand Up @@ -2009,7 +2008,7 @@ DataFrame_write_ipc = function(
) |>
unwrap("in $write_ipc():")

invisible(NULL)
invisible(self)
}


Expand Down Expand Up @@ -2044,7 +2043,7 @@ DataFrame_write_parquet = function(
) |>
unwrap("in $write_parquet():")

invisible(NULL)
invisible(self)
}

#' Write to JSON file
Expand Down Expand Up @@ -2075,7 +2074,7 @@ DataFrame_write_json = function(
.pr$DataFrame$write_json(self, file, pretty, row_oriented) |>
unwrap("in $write_json():")

invisible(NULL)
invisible(self)
}

#' Write to NDJSON file
Expand All @@ -2096,7 +2095,7 @@ DataFrame_write_ndjson = function(file) {
.pr$DataFrame$write_ndjson(self, file) |>
unwrap("in $write_ndjson():")

invisible(NULL)
invisible(self)
}

#' @inherit LazyFrame_rolling title description params details
Expand Down
Loading

0 comments on commit 1a87e1f

Please sign in to comment.