-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: Expressify str.json_path_match
#15764
Conversation
e705c55
to
8884035
Compare
fn json_path_match(&self, json_path: &StringChunked) -> PolarsResult<StringChunked> { | ||
let ca = self.as_string(); | ||
match (ca.len(), json_path.len()) { | ||
(_, 1) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not let this branch merge with the following broadcast_try_binary_elementwise
branch as we only need compile the json_path
once.
broadcast_try_binary_elementwise(ca, json_path, |opt_str, opt_path| { | ||
match (opt_str, opt_path) { | ||
(Some(str_val), Some(path)) => { | ||
PathCompiled::compile(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory, this could be further optimized with FastFixedCache
, but PathCompile<'a>
, unlike Regex
, has a lifetime annotation making borrow checker unhappy. We should be able to find a way to make it work, but I think it make sense that we leave this for the next perf PR.
CodSpeed Performance ReportMerging #15764 will not alter performanceComparing Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15764 +/- ##
==========================================
+ Coverage 81.35% 81.36% +0.01%
==========================================
Files 1379 1379
Lines 176619 176640 +21
Branches 2544 2544
==========================================
+ Hits 143686 143721 +35
+ Misses 32449 32437 -12
+ Partials 484 482 -2 ☔ View full report in Codecov by Sentry. |
Closes #15613.