nevi-me commented on a change in pull request #7036: URL: https://github.com/apache/arrow/pull/7036#discussion_r414875192
########## File path: rust/arrow/src/array/array.rs ########## @@ -1786,38 +1786,34 @@ impl From<(Vec<(Field, ArrayRef)>, Buffer, usize)> for StructArray { /// This is mostly used to represent strings or a limited set of primitive types as integers, /// for example when doing NLP analysis or representing chromosomes by name. /// -/// Example with nullable data: +/// Example **with nullable** data: /// /// ``` -/// use arrow::array::DictionaryArray; -/// use arrow::datatypes::Int8Type; -/// let test = vec!["a", "a", "b", "c"]; -/// let array : DictionaryArray<Int8Type> = test.iter().map(|&x| if x == "b" {None} else {Some(x)}).collect(); -/// assert_eq!(array.keys().collect::<Vec<Option<i8>>>(), vec![Some(0), Some(0), None, Some(1)]); +/// use arrow::array::DictionaryArray; +/// use arrow::datatypes::Int8Type; +/// let test = vec!["a", "a", "b", "c"]; +/// let array : DictionaryArray<Int8Type> = test.iter().map(|&x| if x == "b" {None} else {Some(x)}).collect(); +/// assert_eq!(array.keys().collect::<Vec<Option<i8>>>(), vec![Some(0), Some(0), None, Some(1)]); /// ``` /// -/// Example without nullable data: +/// Example **without nullable** data: /// /// ``` -/// -/// use arrow::array::DictionaryArray; -/// use arrow::datatypes::Int8Type; -/// let test = vec!["a", "a", "b", "c"]; -/// let array : DictionaryArray<Int8Type> = test.into_iter().collect(); -/// assert_eq!(array.keys().collect::<Vec<Option<i8>>>(), vec![Some(0), Some(0), Some(1), Some(2)]); +/// use arrow::array::DictionaryArray; +/// use arrow::datatypes::Int8Type; +/// let test = vec!["a", "a", "b", "c"]; +/// let array : DictionaryArray<Int8Type> = test.into_iter().collect(); +/// assert_eq!(array.keys().collect::<Vec<Option<i8>>>(), vec![Some(0), Some(0), Some(1), Some(2)]); /// ``` pub struct DictionaryArray<K: ArrowPrimitiveType> { - // Array of keys, much like a PrimitiveArray + /// Array of keys, much like a PrimitiveArray data: ArrayDataRef, - // Pointer to the key values. + /// Pointer to the key values. raw_values: RawPtrBox<K::Native>, - // Array of any values. + /// Array of any values. values: ArrayRef, - Review comment: `is_ordered` is needed for IPC purposes, so we shouldn't remove it for compatibility purposes ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org