-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
ARROW-10639: [Rust] Added examples to is_null kernel and simplified signature. #8701
Conversation
Any thoughts, @alamb , @nevi-me , @andygrove , since the requirement of |
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.
This is a good pr and breaking change for some code. p.s. we need to change some code internally after this pr.
/// # Error | ||
/// This function never errors. | ||
/// # Example | ||
/// ```rust |
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.
What I do in doctests and comments is give a space between each of them like:
/// # Error | |
/// This function never errors. | |
/// # Example | |
/// ```rust | |
/// # Error | |
/// | |
/// This function never errors. | |
/// | |
/// # Example | |
/// | |
/// ```rust |
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.
This looks good to me, FWIW.
It seems to me ArrayRef
is only valuable if the code needs a very cheap way to copy the entire input (e.g. to another record batch). Given that is not the case with is_not_null
I think removing the Arc
wrapper makes the API more general. 👍
CI failure looks unrelated .https://github.com/apache/arrow/pull/8701/checks?check_run_id=1416672486
I am restarting it |
…ignature. The change in signature was motivated while writing the example: there is no reason to wrap a concrete array on an `Arc` just to be able to pass it to the kernel. All kernels require an immutable reference to anything that implements `Array`, and thus asking for `&Arc<dyn Array>` seems to be equivalent / worse as asking for `&Vec<>` instead of `&[]` that clippy complaints about. Apart from that, this adds the examples. Closes apache#8701 from jorgecarleitao/is_null_array Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>
The change in signature was motivated while writing the example: there is no reason to wrap a concrete array on an
Arc
just to be able to pass it to the kernel. All kernels require an immutable reference to anything that implementsArray
, and thus asking for&Arc<dyn Array>
seems to be equivalent / worse as asking for&Vec<>
instead of&[]
that clippy complaints about.Apart from that, this adds the examples.