klion26 commented on code in PR #8719:
URL: https://github.com/apache/arrow-rs/pull/8719#discussion_r2465303051
##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -58,11 +62,11 @@ impl ExtensionType for VariantType {
Some(String::new())
}
- fn deserialize_metadata(_metadata: Option<&str>) -> Result<Self::Metadata,
ArrowError> {
+ fn deserialize_metadata(_metadata: Option<&str>) -> Result<Self::Metadata>
{
Review Comment:
The modifications here were made because `arrow::error::Result` was
introduced.
##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -325,12 +329,32 @@ impl VariantArray {
/// Return the [`Variant`] instance stored at the given row
///
- /// Note: This method does not check for nulls and the value is arbitrary
- /// (but still well-defined) if [`is_null`](Self::is_null) returns true
for the index.
+ /// This is a convenience wrapper that calls [`VariantArray::try_value`]
and unwraps the `Result`.
+ /// Use `try_value` if you need to handle conversion errors gracefully.
///
/// # Panics
/// * if the index is out of bounds
/// * if the array value is null
+ /// * if `try_value` returns an error.
+ pub fn value(&self, index: usize) -> Variant<'_, '_> {
Review Comment:
Currently, `variant_get` still uses `VariantArray::value`, Will change
`variant_get` to use `VariantArray::try_value` and 1) return `Variant::NULL` if
`CastOptions::safe` is true; 2) Err if `CastOptions::safe` is false
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]