Releases: pola-rs/r-polars
Releases · pola-rs/r-polars
v0.12.1
This version includes a few additional features and a large amount of documentation improvements.
Deprecations
pl$polars_info()
is moved topolars_info()
.pl$polars_info()
is deprecated and will be removed in 0.13.0 (#662).
Rust-polars update
- rust-polars is updated to 0.36.2 (#659). Most of the changes from 0.35.x to 0.36.2 were covered in R polars 0.12.0.
The main change is thatpl$Utf8
is replaced bypl$String
.pl$Utf8
is an alias and will keep working, butpl$String
is now preferred in the documentation and in new code.
What's changed
- New methods
$str$reverse()
,$str$contains_any()
, and$str$replace_many()
(#641). - New methods
$rle()
and$rle_id()
(#648). - New functions
is_polars_df()
,is_polars_lf()
,is_polars_series()
(#658). $gather()
now accepts negative indexing (#659).
Miscellaneous
- Remove the
Makefile
in favor ofTaskfile.yml
. Please usetask
instead ofmake
as a task runner in the development (#654).
lib-v0.36.0
feat: Bump rust-polars to 0.36.2 (#659) Co-authored-by: eitsupi <[email protected]>
v0.12.0
BREAKING CHANGES DUE TO RUST-POLARS UPDATE
- rust-polars is updated to 2023-12-25 unreleased version (#601, #622).
This is the same version of Python Polars package 0.20.2, so please check
the upgrade guide for details too.pl$scan_csv()
andpl$read_csv()
'scomment_char
argument is renamedcomment_prefix
.<DataFrame>$frame_equal()
and<Series>$series_equal()
are renamed
to<DataFrame>$equals()
and<Series>$equals()
.<Expr>$rolling_*
functions gained an argumentwarn_if_unsorted
.<Expr>$str$json_extract()
is renamed to<Expr>$str$json_decode()
.- Change default join behavior with regard to
null
values. - Preserve left and right join keys in outer joins.
count
now ignores null values.NaN
values are now considered equal.$gather_every()
gained an argumentoffset
.
Breaking changes and deprecations
$apply()
on an Expr or a Series is renamed$map_elements()
, and$map()
is renamed$map_batches()
.$map()
and$apply()
will be removed in 0.13.0 (#534).- Removed
$days()
,$hours()
,$minutes()
,$seconds()
,$milliseconds()
,
$microseconds()
,$nanoseconds()
. Those were deprecated in 0.11.0 (#550). pl$concat_list()
: elements being strings are now interpreted as column names.
Usepl$lit
to concat with a string.<RPolarsExpr>$lit_to_s()
is renamed to<RPolarsExpr>$to_series()
(#582).<RPolarsExpr>$lit_to_df()
is removed (#582).- Change class names and function names associated with class names.
- The class name of all objects created by polars (
DataFrame
,LazyFrame
,
Expr
,Series
, etc.) has changed. They now start withRPolars
, for example
RPolarsDataFrame
. This will only break your code if you directly use those
class names, such as in S3 methods (#554, #585). - Private methods have been unified so that they do not have the
RPolars
prefix (#584).
- The class name of all objects created by polars (
What's changed
- The Extract function (
[
) for DataFrame can use columns not included in the
result for filtering (#547). - The Extract function (
[
) for LazyFrame can filter rows with Expressions (#547). as_polars_df()
fordata.frame
has a new argumentrownames
for to convert
the row.names attribute to a column.
This option is inspired by thetibble::as_tibble()
function (#561).as_polars_df()
fordata.frame
has a new argumentmake_names_unique
(#561).- New methods
$str$to_date()
,$str$to_time()
,$str$to_datetime()
as
alternatives to$str$strptime()
(#558). - The
dim()
function for DataFrame and LazyFrame correctly returns integer instead of
double (#577). - The conversion of R's
POSIXct
class to Polars datetime now works correctly with millisecond
precision (#589). <LazyFrame>$filter()
,<DataFrame>$filter()
, andpl$when()
now allow multiple conditions
to be separated by commas, likelf$filter(pl$col("foo") == 1, pl$col("bar") != 2)
(#598).- New method
$replace()
for expressions (#601). - Better error messages for trailing argument commas such as
pl$DataFrame()$select("a",)
(#607). - New function
pl$threadpool_size()
to get the number of threads used by Polars (#620).
Thread pool size is also included in the output ofpl$polars_info()
.
lib-v0.35.1
docs(website): better display of "Usage" section (#626) Co-authored-by: eitsupi <[email protected]>
v0.11.0
BREAKING CHANGES DUE TO RUST-POLARS UPDATE
- rust-polars is updated to 0.35.0 (2023-11-17) (#515)
- changes in
$write_csv()
andsink_csv()
:has_header
is renamed
include_header
and there's a new argumentinclude_bom
. pl$cov()
gains addof
argument.$cumsum()
,$cumprod()
,$cummin()
,$cummax()
,$cumcount()
are
renamed$cum_sum()
,$cum_prod()
,$cum_min()
,$cum_max()
,
$cum_count()
.take()
andtake_every()
are renamed$gather()
andgather_every()
.$shift()
and$shift_and_fill()
now accept Expr as input.- when
reverse = TRUE
,$arg_sort()
now places null values in the first
positions. - Removed argument
ambiguous
in$dt$truncate()
and$dt$round()
. $str$concat()
gains an argumentignore_nulls
.
- changes in
Breaking changes and deprecations
- The rowwise computation when several columns are passed to
pl$min()
,pl$max()
,
andpl$sum()
is deprecated and will be removed in 0.12.0. Passing several
columns to these functions will now compute the min/max/sum in each column
separately. Usepl$min_horizontal()
pl$max_horizontal()
, and
pl$sum_horizontal()
instead for rowwise computation (#508). $is_not()
is deprecated and will be removed in 0.12.0. Use$not()
instead
(#511, #531).$is_first()
is deprecated and will be removed in 0.12.0. Use$is_first_distinct()
instead (#531).- In
pl$concat()
, the argumentto_supertypes
is removed. Use the suffix
"_relaxed"
in thehow
argument to cast columns to their shared supertypes
(#523). - All duration methods (
days()
,hours()
,minutes()
,seconds()
,
milliseconds()
,microseconds()
,nanoseconds()
) are renamed, for example
from$dt$days()
to$dt$total_days()
. The old usage is deprecated and will
be removed in 0.12.0. - DataFrame methods
$as_data_frame()
is removed in favor of$to_data_frame()
(#533). - GroupBy methods
$as_data_frame()
and$to_data_frame()
which were used to
convert GroupBy objects to R data frames are removed.
Use$ungroup()
method and theas.data.frame()
function instead (#533).
What's changed
- Fix the installation issue on Ubuntu 20.04 (#528, thanks @brownag).
- New methods
$write_json()
and$write_ndjson()
for DataFrame (#502). - Removed argument
name
inpl$date_range()
, which was deprecated for a while
(#503). - New private method
.pr$DataFrame$drop_all_in_place(df)
to dropDataFrame
in-place, to release memory without invoking gc(). However, if there are other
strong references to any of the underlying Series or arrow arrays, that memory
will specifically not be released. This method is aimed for r-polars extensions,
and will be kept stable as much as possible (#504). - New functions
pl$min_horizontal()
,pl$max_horizontal()
,pl$sum_horizontal()
,
pl$all_horizontal()
,pl$any_horizontal()
(#508). - New generic functions
as_polars_df()
andas_polars_lf()
to create polars
DataFrames and LazyFrames (#519). - New method
$ungroup()
forGroupBy
andLazyGroupBy
(#522). - New method
$rolling()
to apply an Expr over a rolling window based on
date/datetime/numeric indices (#470). - New methods
$name$to_lowercase()
and$name$to_uppercase()
to transform
variable names (#529). - New method
$is_last_distinct()
(#531). - New methods of the Expressions class,
$floor_div()
,$mod()
,$eq_missing()
and$neq_missing()
. The base R operators%/%
and%%
for Expressions are
now translated to$floor_div()
and$mod()
(#523).- Note that
$mod()
of Polars is different from the R operator%%
, which is
not guaranteedx == (x %% y) + y * (x %/% y)
.
Please check the upstream issue pola-rs/polars#10570.
- Note that
- The extract function (
[
) for polars objects now behave more like for base R objects (#543).
lib-v0.35.0
docs(news): tweak news (#539)
v0.10.1
What's changed
- The argument
quote_style
in$write_csv()
and$sink_csv()
can now take
the value"never"
(#483). pl$DataFrame()
now errors if the variables specified inschema
do not exist
in the data (#486).- S3 methods for base R functions are well documented (#494).
- A bug that failing
pl$SQLContext()$register()
without load the package was fixed (#496).
lib-v0.34.1
docs(NEWS): tweak news about recent updates (#498)
v0.10.0
BREAKING CHANGES DUE TO RUST-POLARS UPDATE
- rust-polars is updated to 2023-10-25 unreleased version (#442)
- New subnamespace
"name"
that contains methods$prefix()
,$suffix()
keep()
(renamed fromkeep_name()
) andmap()
(renamed frommap_alias()
). $dt$round()
gains an argumentambiguous
.- The following methods now accept an
Expr
as input:$top_k()
,$bottom_k()
,
$list$join()
,$str$strip_chars()
,$str$strip_chars_start()
,
$str$strip_chars_end()
,$str$split_exact()
. - The following methods were renamed:
$str$n_chars()
->$str$len_chars()
$str$lengths()
->$str$len_bytes()
$str$ljust()
->$str$pad_end()
$str$rjust()
->$str$pad_start()
$concat()
withhow = "diagonal"
now accepts an argumentto_supertypes
to automatically convert concatenated columns to the same type.pl$enable_string_cache()
doesn't take any argument anymore. The string cache
can now be disabled withpl$disable_string_cache()
.$scan_parquet()
gains an argumenthive_partitioning
.$meta$tree_format()
has a better formatted output.
- New subnamespace
Breaking changes
$scan_csv()
and$read_csv()
now match more closely the Python-Polars API (#455):sep
is renamedseparator
,overwrite_dtypes
is renameddtypes
,
parse_dates
is renamedtry_parse_dates
.- new arguments
rechunk
,eol_char
,raise_if_empty
,truncate_ragged_lines
path
can now be a vector of characters indicating several paths to CSV files.
This only works if all CSV files have the same schema.
What's changed
- New class
RPolarsSQLContext
and its methods to perform SQL queries on DataFrame-
like objects. To use this feature, needs to build Rust library with full features
(#457). - New methods
$peak_min()
and$peak_max()
to find local minima and maxima in
an Expr (#462). - New methods
$read_ndjson()
and$scan_ndjson()
(#471). - New method
$with_context()
forLazyFrame
to have access to columns from
other Data/LazyFrames during the computation.
lib-v0.34.0
chore: fix typo and revert Rd file incorrect change (#476)