Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump rust polars to 0.39.1 #1042

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ Collate:
'zzz.R'
Config/rextendr/version: 0.3.1
VignetteBuilder: knitr
Config/polars/LibVersion: 0.39.0
Config/polars/RustToolchainVersion: nightly-2024-03-28
Config/polars/LibVersion: 0.39.1
Config/polars/RustToolchainVersion: nightly-2024-04-15
8 changes: 2 additions & 6 deletions R/expr__array.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ ExprArr_sum = function() .pr$Expr$arr_sum(self)
#' @return Expr
#' @inherit ExprStr_to_titlecase details
#' @aliases arr_max
#' @examplesIf polars_info()$features$nightly
#' @examples
#' df = pl$DataFrame(
#' values = list(c(1, 2), c(3, 4), c(5, 6)),
#' schema = list(values = pl$Array(pl$Float64, 2))
#' )
#' df$with_columns(max = pl$col("values")$arr$max())
ExprArr_max = function() {
check_feature("nightly", "in $arr$max():")

.pr$Expr$arr_max(self)
}

Expand All @@ -38,15 +36,13 @@ ExprArr_max = function() {
#' @inherit ExprStr_to_titlecase details
#' @return Expr
#' @aliases arr_min
#' @examplesIf polars_info()$features$nightly
#' @examples
#' df = pl$DataFrame(
#' values = list(c(1, 2), c(3, 4), c(5, 6)),
#' schema = list(values = pl$Array(pl$Float64, 2))
#' )
#' df$with_columns(min = pl$col("values")$arr$min())
ExprArr_min = function() {
check_feature("nightly", "in $arr$min():")

.pr$Expr$arr_min(self)
}

Expand Down
66 changes: 33 additions & 33 deletions src/rust/Cargo.lock

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

9 changes: 5 additions & 4 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "r-polars"
version = "0.39.0"
version = "0.39.1"
edition = "2021"
rust-version = "1.76.0"
publish = false
Expand Down Expand Up @@ -52,8 +52,8 @@ serde_json = "*"
smartstring = "1.0.1"
state = "0.6.0"
thiserror = "1.0.58"
polars-core = { git = "https://github.com/pola-rs/polars.git", rev = "37c630320da0d0d3270d283cdafbf6b8402de069", default-features = false }
polars-lazy = { git = "https://github.com/pola-rs/polars.git", rev = "37c630320da0d0d3270d283cdafbf6b8402de069", default-features = false }
polars-core = { git = "https://github.com/pola-rs/polars.git", rev = "5e6854171b4883418c9dbc5dd20f1bb10a23f98f", default-features = false }
polars-lazy = { git = "https://github.com/pola-rs/polars.git", rev = "5e6854171b4883418c9dbc5dd20f1bb10a23f98f", default-features = false }
either = "1"
#features copied from node-polars

Expand Down Expand Up @@ -93,6 +93,7 @@ features = [
"extract_groups",
"extract_jsonpath",
"ewma",
"ewma_by",
"find_many",
"fmt",
"interpolate",
Expand Down Expand Up @@ -154,4 +155,4 @@ features = [
"zip_with",
]
git = "https://github.com/pola-rs/polars.git"
rev = "37c630320da0d0d3270d283cdafbf6b8402de069"
rev = "5e6854171b4883418c9dbc5dd20f1bb10a23f98f"
54 changes: 15 additions & 39 deletions tests/testthat/test-expr_array.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,8 @@ test_that("arr$sum", {
)
})

# TODO: reenable if the upstream issue is fixed <https://github.com/pola-rs/polars/issues/15646>
# test_that("arr$max and arr$min", {
# skip_if_not(polars_info()$features$nightly)

# df = pl$DataFrame(
# ints = list(1:2, c(1L, NA_integer_), c(NA_integer_, NA_integer_)),
# floats = list(c(1, 2), c(1, NA_real_), c(NA_real_, NA_real_)),
# schema = list(
# ints = pl$Array(pl$Int32, 2),
# floats = pl$Array(pl$Float32, 2)
# )
# )
# # max ---
# expect_identical(
# df$select(pl$col("ints")$arr$max())$to_list(),
# list(ints = c(2L, 1L, NA_integer_))
# )
# expect_identical(
# df$select(pl$col("floats")$arr$max())$to_list(),
# list(floats = c(2, 1, NA_real_))
# )

# # min ---
# expect_identical(
# df$select(pl$col("ints")$arr$min())$to_list(),
# list(ints = c(1L, 1L, NA_integer_))
# )
# expect_identical(
# df$select(pl$col("floats")$arr$min())$to_list(),
# list(floats = c(1, 1, NA_real_))
# )
# })

test_that("arr$max and arr$min error if the nightly feature is false", {
skip_if(polars_info()$features$nightly)

test_that("arr$max and arr$min", {
df = pl$DataFrame(
ints = list(1:2, c(1L, NA_integer_), c(NA_integer_, NA_integer_)),
floats = list(c(1, 2), c(1, NA_real_), c(NA_real_, NA_real_)),
Expand All @@ -62,13 +28,23 @@ test_that("arr$max and arr$min error if the nightly feature is false", {
)
)
# max ---
expect_grepl_error(
df$select(pl$col("ints")$arr$max())$to_list()
expect_identical(
df$select(pl$col("ints")$arr$max())$to_list(),
list(ints = c(2L, 1L, NA_integer_))
)
expect_identical(
df$select(pl$col("floats")$arr$max())$to_list(),
list(floats = c(2, 1, NA_real_))
)

# min ---
expect_grepl_error(
df$select(pl$col("ints")$arr$min())$to_list()
expect_identical(
df$select(pl$col("ints")$arr$min())$to_list(),
list(ints = c(1L, 1L, NA_integer_))
)
expect_identical(
df$select(pl$col("floats")$arr$min())$to_list(),
list(floats = c(1, 1, NA_real_))
)
})

Expand Down
6 changes: 0 additions & 6 deletions tools/lib-sums.tsv

This file was deleted.

Loading