Skip to content

Commit

Permalink
Array display
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Mar 6, 2024
1 parent 1a3bfb6 commit 329499b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion vortex-array/src/array/bool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ impl ArrayDisplay for BoolArray {
let true_count = self.stats().get_or_compute_or(0usize, &Stat::TrueCount);
let false_count = self.len() - true_count;
f.property("n_true", true_count)?;
f.property("n_false", false_count)
f.property("n_false", false_count)?;
f.maybe_child("validity", self.validity())
}
}

Expand Down
3 changes: 2 additions & 1 deletion vortex-array/src/array/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ impl ArrayDisplay for PrimitiveArray {
f.property("values", format!("{:?}{}",
&self.buffer().typed_data::<$P>()[..min(10, self.len())],
if self.len() > 10 { "..." } else { "" }))
})
})?;
f.maybe_child("validity", self.validity())
}
}

Expand Down
3 changes: 2 additions & 1 deletion vortex-array/src/array/varbin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ impl Encoding for VarBinEncoding {
impl ArrayDisplay for VarBinArray {
fn fmt(&self, f: &mut ArrayFormatter) -> std::fmt::Result {
f.child("offsets", self.offsets())?;
f.child("bytes", self.bytes())
f.child("bytes", self.bytes())?;
f.maybe_child("validity", self.validity())
}
}

Expand Down
2 changes: 1 addition & 1 deletion vortex-array/src/array/varbinview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl ArrayDisplay for VarBinViewArray {
for (i, d) in self.data().iter().enumerate() {
f.child(&format!("data_{}", i), d.as_ref())?;
}
Ok(())
f.maybe_child("validity", self.validity())
}
}

Expand Down

0 comments on commit 329499b

Please sign in to comment.