-
-
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
fix: Return the truth values of ne_missing
and eq_missing
operations for struct instead of null
#18930
fix: Return the truth values of ne_missing
and eq_missing
operations for struct instead of null
#18930
Changes from 7 commits
d0b0385
434b124
e90a30f
7ddee06
bc51878
87559e6
9b45bbd
9d0e073
b26829f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -759,6 +759,7 @@ fn struct_helper<F, R>( | |
op: F, | ||
reduce: R, | ||
value: bool, | ||
apply_null_validity: bool, | ||
) -> BooleanChunked | ||
where | ||
F: Fn(&Series, &Series) -> BooleanChunked, | ||
|
@@ -778,7 +779,8 @@ where | |
.map(|(l, r)| op(l, r)) | ||
.reduce(reduce) | ||
.unwrap(); | ||
if a.null_count() > 0 || b.null_count() > 0 { | ||
|
||
if apply_null_validity & (a.null_count() > 0 || b.null_count() > 0) { | ||
let mut a = a.into_owned(); | ||
a.zip_outer_validity(&b); | ||
unsafe { | ||
|
@@ -787,6 +789,7 @@ where | |
} | ||
} | ||
} | ||
|
||
out | ||
} | ||
} | ||
|
@@ -801,6 +804,7 @@ impl ChunkCompareEq<&StructChunked> for StructChunked { | |
|l, r| l.equal(r).unwrap(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this is not what this PR is trying to solve, but we made a policy that nested equality is always eq_missing. Maybe, this should changed here too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sense, thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think not all types support |
||
|a, b| a.bitand(b), | ||
false, | ||
true, | ||
) | ||
} | ||
|
||
|
@@ -811,6 +815,7 @@ impl ChunkCompareEq<&StructChunked> for StructChunked { | |
|l, r| l.equal_missing(r).unwrap(), | ||
|a, b| a.bitand(b), | ||
false, | ||
false, | ||
) | ||
} | ||
|
||
|
@@ -821,6 +826,7 @@ impl ChunkCompareEq<&StructChunked> for StructChunked { | |
|l, r| l.not_equal(r).unwrap(), | ||
|a, b| a | b, | ||
true, | ||
true, | ||
) | ||
} | ||
|
||
|
@@ -831,6 +837,7 @@ impl ChunkCompareEq<&StructChunked> for StructChunked { | |
|l, r| l.not_equal_missing(r).unwrap(), | ||
|a, b| a | b, | ||
true, | ||
false, | ||
) | ||
} | ||
} | ||
|
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.
nit: this is named
is_missing
in other helpers. Maybe that should be here as well. Not really a blocker thoughThere 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.
Sure, I will rename to
is_missing