Skip to content

Commit

Permalink
Use strict cast
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumiller committed Feb 12, 2024
1 parent a349832 commit 0bf53a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/polars-ops/src/chunked_array/strings/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ pub trait StringNameSpaceImpl: AsString {
/// the end of the string.
fn str_head(&self, n: &Series) -> PolarsResult<StringChunked> {
let ca = self.as_string();
let n = n.cast(&DataType::Int64)?;
let n = n.strict_cast(&DataType::Int64)?;

Ok(substring::head(ca, n.i64()?))
}
Expand All @@ -609,7 +609,7 @@ pub trait StringNameSpaceImpl: AsString {
/// negative, in which case the slice begins `n` characters from the end of the string.
fn str_tail(&self, n: &Series) -> PolarsResult<StringChunked> {
let ca = self.as_string();
let n = n.cast(&DataType::Int64)?;
let n = n.strict_cast(&DataType::Int64)?;

Ok(substring::tail(ca, n.i64()?))
}
Expand Down

0 comments on commit 0bf53a1

Please sign in to comment.