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

Update Polars to v0.28 #570

Merged
merged 1 commit into from Apr 12, 2023
Merged

Update Polars to v0.28 #570

merged 1 commit into from Apr 12, 2023

Conversation

philss
Copy link
Member

@philss philss commented Apr 11, 2023

It also applies some of the changes necessary to make our code work for this version.

See the Polars release notes for more details: https://github.com/pola-rs/polars/releases/tag/rs-0.28

@@ -1118,7 +1118,8 @@ pub fn s_not(s1: ExSeries) -> Result<ExSeries, ExplorerError> {

#[rustler::nif(schedule = "DirtyCpu")]
pub fn s_contains(s1: ExSeries, pattern: &str) -> Result<ExSeries, ExplorerError> {
Ok(ExSeries::new(s1.utf8()?.contains(pattern)?.into()))
// TODO: maybe have "strict" as an option.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would the strict option do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs don't say much :/

But for what I could understand, it is related to how the Regex is interpreted: https://pola-rs.github.io/polars/src/polars_ops/chunked_array/strings/namespace.rs.html#136

If it's "strict", then the regex must be valid. In case it's not strict and an invalid regex is used, it is going to search for "None" - nils.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philss for us contain is never a regex, so we need to make sure our pattern is not being interpreted as a regex.

@philss philss merged commit ce8a673 into main Apr 12, 2023
3 checks passed
@philss philss deleted the ps-update-polars-to-v0.28 branch April 12, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants