Skip to content

Commit

Permalink
Improve list builder usage example in docs (#6775)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
findepi authored Nov 22, 2024
1 parent da840ed commit 9705563
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arrow-array/src/builder/generic_list_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ use std::sync::Arc;
/// builder.append(true);
///
/// // Null
/// builder.values().append_value("?"); // irrelevant
/// builder.append(false);
///
/// // [D]
Expand All @@ -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]
/// );
/// ```
///
Expand Down

0 comments on commit 9705563

Please sign in to comment.