This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 97055631c Improve list builder usage example in docs (#6775)
97055631c is described below
commit 97055631cc1b5a79a3e7d5f0399a5a0410c5fd57
Author: Piotr Findeisen <[email protected]>
AuthorDate: Fri Nov 22 23:36:00 2024 +0100
Improve list builder usage example in docs (#6775)
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 a7d16f45f..14c3ba79c 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]
/// );
/// ```
///