Skip to content

Commit cf75773

Browse files
committed
feat[array]: validity in display array
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 8113798 commit cf75773

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

vortex-array/src/display/tree.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,25 @@ impl<'a, 'b: 'a> TreeFormatter<'a, 'b> {
3939
} else {
4040
100_f64 * nbytes as f64 / total_size as f64
4141
};
42+
// Compute validity status string
43+
let validity_str = if !array.dtype().is_nullable() {
44+
""
45+
} else if array.all_valid() {
46+
" all_valid"
47+
} else if array.all_invalid() {
48+
" all_invalid"
49+
} else {
50+
""
51+
};
52+
4253
writeln!(
4354
self,
44-
"{}: {} nbytes={} ({:.2}%)",
55+
"{}: {} nbytes={} ({:.2}%){}",
4556
name,
4657
array.display_as(DisplayOptions::MetadataOnly),
4758
format_size(nbytes, DECIMAL),
48-
percent
59+
percent,
60+
validity_str
4961
)?;
5062

5163
self.indent(|i| {

0 commit comments

Comments
 (0)