From ea03c579a2471c03010dd25474fa19d430c35859 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 22 Nov 2024 21:17:48 +0100 Subject: [PATCH] Improve list builder usage example in docs The example could leave the impression that it is important to append some dummy element (which value is irrelevant) to values builder when constructing null list entry. --- arrow-array/src/builder/generic_list_builder.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arrow-array/src/builder/generic_list_builder.rs b/arrow-array/src/builder/generic_list_builder.rs index a7d16f45f53b..14c3ba79cdf7 100644 --- a/arrow-array/src/builder/generic_list_builder.rs +++ b/arrow-array/src/builder/generic_list_builder.rs @@ -49,7 +49,6 @@ use std::sync::Arc; /// builder.append(true); /// /// // Null -/// builder.values().append_value("?"); // irrelevant /// builder.append(false); /// /// // [D] @@ -70,15 +69,14 @@ use std::sync::Arc; /// array.values().as_ref(), /// &StringArray::from(vec![ /// Some("A"), Some("B"), Some("C"), -/// Some("?"), Some("D"), None, -/// Some("F") +/// Some("D"), None, Some("F") /// ]) /// ); /// /// // Offsets are indexes into the values array /// assert_eq!( /// array.value_offsets(), -/// &[0, 3, 3, 4, 5, 7] +/// &[0, 3, 3, 3, 4, 6] /// ); /// ``` ///