Skip to content

Commit

Permalink
Updated Polars to 0.38.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 29, 2024
1 parent a4f045f commit 3b48597
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 52 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 0.9.0 (unreleased)

- Updated Polars to 0.37.0
- Updated Polars to 0.38.0
- Added `Enum` type
- Added `sink_ipc`, `sink_csv`, and `sink_ndjson` methods to `LazyFrame`
- Added `replace` method to `Series` and `Expr`
Expand Down
102 changes: 65 additions & 37 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
members = ["ext/polars"]
resolver = "2"

[patch.crates-io]
jsonpath_lib = { git = "https://github.com/ritchie46/jsonpath", rev = "24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b" }

[profile.release]
strip = true
8 changes: 4 additions & 4 deletions ext/polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ ahash = "0.8"
chrono = "0.4"
either = "1.8"
magnus = "0.6"
polars-core = "=0.37.0"
polars-parquet = "=0.37.0"
polars-utils = "=0.37.0"
polars-core = "=0.38.0"
polars-parquet = "=0.38.0"
polars-utils = "=0.38.0"
serde_json = "1"
smartstring = "1"

[dependencies.polars]
version = "=0.37.0"
version = "=0.38.0"
features = [
"abs",
"approx_unique",
Expand Down
11 changes: 10 additions & 1 deletion ext/polars/src/conversion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use polars::io::avro::AvroCompression;
use polars::prelude::*;
use polars::series::ops::NullBehavior;
use polars_core::utils::arrow::array::Array;
use polars_utils::total_ord::TotalEq;
use polars_utils::total_ord::{TotalEq, TotalHash};
use smartstring::alias::String as SmartString;

use crate::object::OBJECT_NAME;
Expand Down Expand Up @@ -423,6 +423,15 @@ impl TotalEq for ObjectValue {
}
}

impl TotalHash for ObjectValue {
fn tot_hash<H>(&self, state: &mut H)
where
H: Hasher,
{
self.hash(state);
}
}

impl Display for ObjectValue {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.to_object())
Expand Down
6 changes: 3 additions & 3 deletions ext/polars/src/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,9 +935,9 @@ impl RbDataFrame {
#[allow(clippy::too_many_arguments)]
pub fn pivot_expr(
&self,
values: Vec<String>,
index: Vec<String>,
columns: Vec<String>,
values: Option<Vec<String>>,
maintain_order: bool,
sort_columns: bool,
aggregate_expr: Option<&RbExpr>,
Expand All @@ -950,9 +950,9 @@ impl RbDataFrame {
let agg_expr = aggregate_expr.map(|aggregate_expr| aggregate_expr.inner.clone());
let df = fun(
&self.df.borrow(),
values,
index,
columns,
values,
sort_columns,
agg_expr,
separator.as_deref(),
Expand Down Expand Up @@ -1134,7 +1134,7 @@ impl RbDataFrame {
};
Ok(self
.df
.borrow()
.borrow_mut()
.transpose(keep_names_as.as_deref(), new_col_names)
.map_err(RbPolarsErr::from)?
.into())
Expand Down
2 changes: 1 addition & 1 deletion ext/polars/src/expr/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl RbExpr {
self.inner
.clone()
.list()
.take(index.inner.clone(), null_on_oob)
.gather(index.inner.clone(), null_on_oob)
.into()
}

Expand Down
2 changes: 1 addition & 1 deletion ext/polars/src/functions/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pub fn repeat(value: &RbExpr, n: &RbExpr, dtype: Option<Wrap<DataType>>) -> RbRe
}

if let Expr::Literal(lv) = &value {
let av = lv.to_anyvalue().unwrap();
let av = lv.to_any_value().unwrap();
// Integer inputs that fit in Int32 are parsed as such
if let DataType::Int64 = av.dtype() {
let int_value = av.try_extract::<i64>().unwrap();
Expand Down
Loading

0 comments on commit 3b48597

Please sign in to comment.