Skip to content

Commit

Permalink
Using rs-0.34 and git hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bidek56 committed Nov 5, 2023
1 parent 5f33377 commit 1390fc0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
15 changes: 10 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ ahash = "0.8.3"
bincode = "1.3.3"
napi = {version = "2.13.3", default-features = false, features = ["napi8", "serde-json", "experimental"]}
napi-derive = {version = "2.13.0", default-features = false}
polars-core = {version = "0.34.2", default-features = false}
polars-io = {version = "0.34.2", default-features = false}
polars-lazy = {version = "0.34.2", default-features = false}
polars-core = {git = "https://github.com/pola-rs/polars.git", rev = "60adaef43e1b3306d5da8cf736accea2e3f03d9b", default-features = false}
polars-io = {git = "https://github.com/pola-rs/polars.git", rev = "60adaef43e1b3306d5da8cf736accea2e3f03d9b", default-features = false}
polars-lazy = {git = "https://github.com/pola-rs/polars.git", rev = "60adaef43e1b3306d5da8cf736accea2e3f03d9b", default-features = false}
thiserror = "1"
smartstring = { version = "1" }
serde_json = {version = "1"}
Expand Down Expand Up @@ -90,14 +90,19 @@ features = [
"list_eval",
"arg_where",
"timezones",
"string_pad",
"peaks",
"string_justify",
]
version = "0.34.2"
git = "https://github.com/pola-rs/polars.git"
rev = "60adaef43e1b3306d5da8cf736accea2e3f03d9b"

[build-dependencies]
napi-build = "2.0.1"

[profile.release]
codegen-units = 1
lto = "fat"

[features]
default = ["range"]
range = ["polars-lazy/range"]
2 changes: 1 addition & 1 deletion polars/lazy/expr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ export const _Expr = (_expr: any): Expr => {
}
},
shift(periods) {
return _Expr(_expr.shift(exprToLitOrExpr(periods).inner()));
return _Expr(_expr.shift(periods));
},
shiftAndFill(optOrPeriods, fillValue?) {
if (typeof optOrPeriods === "number") {
Expand Down
14 changes: 7 additions & 7 deletions src/lazy/dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ impl JsExpr {
}

#[napi(catch_unwind)]
pub fn shift(&self, periods: &JsExpr) -> JsExpr {
self.clone().inner.shift(periods.inner.clone()).into()
pub fn shift(&self, periods: i64) -> JsExpr {
self.clone().inner.shift(periods).into()
}

#[napi(catch_unwind)]
Expand Down Expand Up @@ -649,7 +649,7 @@ impl JsExpr {
let function = move |s: Series| {
let ca = s.utf8()?;
Ok(Some(
ca.pad_start(length as usize, fill_char.chars().nth(0).unwrap())
ca.rjust(length as usize, fill_char.chars().nth(0).unwrap())
.into_series(),
))
};
Expand All @@ -667,7 +667,7 @@ impl JsExpr {
let function = move |s: Series| {
let ca = s.utf8()?;
Ok(Some(
ca.pad_end(length as usize, fill_char.chars().nth(0).unwrap())
ca.ljust(length as usize, fill_char.chars().nth(0).unwrap())
.into_series(),
))
};
Expand Down Expand Up @@ -1048,15 +1048,15 @@ impl JsExpr {
}
#[napi(catch_unwind)]
pub fn keep_name(&self) -> JsExpr {
self.inner.clone().name().keep().into()
self.inner.clone().keep_name().into()
}
#[napi(catch_unwind)]
pub fn prefix(&self, prefix: String) -> JsExpr {
self.inner.clone().name().prefix(&prefix).into()
self.inner.clone().prefix(&prefix).into()
}
#[napi(catch_unwind)]
pub fn suffix(&self, suffix: String) -> JsExpr {
self.inner.clone().name().suffix(&suffix).into()
self.inner.clone().suffix(&suffix).into()
}

#[napi(catch_unwind)]
Expand Down
6 changes: 3 additions & 3 deletions src/series.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,15 +950,15 @@ impl JsSeries {
pub fn str_pad_start(&self, length: i64, fill_char: String) -> napi::Result<JsSeries> {
let ca = self.series.utf8().map_err(JsPolarsErr::from)?;
let s = ca
.pad_start(length as usize, fill_char.chars().nth(0).unwrap())
.rjust(length as usize, fill_char.chars().nth(0).unwrap())
.into_series();
Ok(s.into())
}
#[napi(catch_unwind)]
pub fn str_pad_end(&self, length: i64, fill_char: String) -> napi::Result<JsSeries> {
let ca = self.series.utf8().map_err(JsPolarsErr::from)?;
let s = ca
.pad_end(length as usize, fill_char.chars().nth(0).unwrap())
.ljust(length as usize, fill_char.chars().nth(0).unwrap())
.into_series();
Ok(s.into())
}
Expand Down Expand Up @@ -1167,7 +1167,7 @@ impl JsSeries {

#[napi(catch_unwind)]
pub fn abs(&self) -> napi::Result<JsSeries> {
let out = abs(&self.series).map_err(JsPolarsErr::from)?;
let out = self.series.abs().map_err(JsPolarsErr::from)?;
Ok(out.into())
}

Expand Down

0 comments on commit 1390fc0

Please sign in to comment.