You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2024/10/10 10:26:55 UTC
[PR] Improve UnionArray::is_nullable [arrow-rs]
tustvold opened a new pull request, #6540:
URL: https://github.com/apache/arrow-rs/pull/6540
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Relates to #6538.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
Always returning true is overly pessimistic, and whilst this is still not accurate, it is at least slightly more accurate
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please add the `breaking change` label.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#discussion_r1796745809
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
The ListArray's field is not nullable, so doesn't permit a nullable child. Without the change in this PR the test fails
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "crepererum (via GitHub)" <gi...@apache.org>.
crepererum commented on code in PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#discussion_r1796735805
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
I see, but it doesn't answer my question.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#issuecomment-2422226846
Thank you everyone
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "crepererum (via GitHub)" <gi...@apache.org>.
crepererum commented on code in PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#discussion_r1796774093
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
Could we also have a more direct check for the code change, i.e. one that directly asserts `UnionArray::is_nullable` (in the respective module)? I'm fine with keeping the actual regression test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "mbrobbel (via GitHub)" <gi...@apache.org>.
mbrobbel commented on code in PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#discussion_r1796694207
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
This is a test from the linked issue https://github.com/apache/arrow-rs/issues/6538.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "crepererum (via GitHub)" <gi...@apache.org>.
crepererum commented on code in PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#discussion_r1796677665
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
I don't understand how this test connects to the code change. All the union members are nullable, no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Improve UnionArray::is_nullable [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #6540:
URL: https://github.com/apache/arrow-rs/pull/6540#discussion_r1804557268
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
I also added a specific test in e78c87bff9
##########
arrow-array/src/array/list_array.rs:
##########
@@ -1181,4 +1181,18 @@ mod tests {
.collect();
assert_eq!(values, vec![Some(vec![1, 2, 3]), None, Some(vec![4, 5, 6])])
}
+
+ #[test]
Review Comment:
I verified that this test fails without the code change:
```
called `Result::unwrap()` on an `Err` value: InvalidArgumentError("Non-nullable field of ListArray \"element\" cannot contain nulls")
thread 'array::list_array::tests::test_nullable_union' panicked at arrow-array/src/array/list_array.rs:228:54:
called `Result::unwrap()` on an `Err` value: InvalidArgumentError("Non-nullable field of ListArray \"element\" cannot contain nulls")
stack backtrace:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org