okhsunrog commented on code in PR #10675:
URL: https://github.com/apache/arrow-rs/pull/10675#discussion_r3795380401
##########
arrow-data/src/transform/mod.rs:
##########
@@ -418,12 +432,30 @@ impl<'a> MutableArrayData<'a> {
/// # Panics
///
/// This function panics if the given `capacities` don't match the data
type
- /// of `arrays`. Or when a [Capacities] variant is not yet supported.
+ /// of `arrays`. Or when a [Capacities] variant is not yet supported. Or
when
+ /// merging dictionary arrays whose combined values overflow the
dictionary key
+ /// type — see [MutableArrayData::try_with_capacities] for a fallible
variant.
pub fn with_capacities(
arrays: Vec<&'a ArrayData>,
use_nulls: bool,
capacities: Capacities,
) -> Self {
+ Self::try_with_capacities(arrays, use_nulls, capacities)
+ .expect("MutableArrayData::new is infallible")
+ }
+
+ /// Fallible variant of [MutableArrayData::with_capacities].
+ ///
+ /// Returns `Err(ArrowError::DictionaryKeyOverflowError)` instead of
panicking when
+ /// merging dictionary arrays whose combined values would overflow the
dictionary
+ /// key type. Still panics for other unsupported combinations
(inconsistent input
+ /// types, unsupported `Capacities` variants) as documented on
+ /// [MutableArrayData::with_capacities].
Review Comment:
Removed the specific error type, just says "returns an error" now. Thanks!
--
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]