Skip to content

Commit

Permalink
Do not return 0th group
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdlineluser committed Jul 31, 2023
1 parent d6c0085 commit 0eb2b86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/polars-ops/src/chunked_array/strings/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ pub trait Utf8NameSpaceImpl: AsUtf8 {

let n_fields = reg.captures_len();

let idxs = (0..n_fields).map(|idx| idx.to_string()).collect::<Vec<_>>();
let idxs = (1..n_fields).map(|idx| idx.to_string()).collect::<Vec<_>>();

let mut builders = idxs
.iter()
.zip(reg.capture_names())
.zip(reg.capture_names().skip(1)) // skip 0th group
.map(|(idx, name)| {
let name = match name {
Some(name) => name,
Expand All @@ -385,6 +385,7 @@ pub trait Utf8NameSpaceImpl: AsUtf8 {
match caps {
Some(caps) => {
caps.iter()
.skip(1) // skip 0th group
.zip(builders.iter_mut())
.for_each(|(m, builder)| match m {
Some(m) => builder.append_value(m.as_str()),
Expand Down

0 comments on commit 0eb2b86

Please sign in to comment.