Skip to content

Commit 89de607

Browse files
committed
Clarify Validity::definitely_all_null doc semantics
Spell out that the method reports whether the validity is definitely all-null, that a `false` result does not prove any value is valid, and point callers at executing the validity into a `Mask` and checking `Mask::all_false` for a definitive answer. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 4f0470e commit 89de607

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

vortex-array/src/validity.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,14 @@ impl Validity {
123123
matches!(self, Self::NonNullable | Self::AllValid)
124124
}
125125

126-
/// Returns `true` if this validity is *definitely* all-null, i.e. it is
127-
/// [`Validity::AllInvalid`].
126+
/// Returns `true` if this validity is *definitely* all-null (every value is null), i.e. it
127+
/// is [`Validity::AllInvalid`].
128128
///
129-
/// Returning `false` does not prove the presence of valid values: a [`Validity::Array`] may
130-
/// still resolve to all-null once executed. Callers must treat `false` as "unknown
131-
/// without compute". This is the all-null counterpart to [`Self::definitely_no_nulls`].
129+
/// Returning `false` does not prove that any value is valid: a [`Validity::Array`] may still
130+
/// resolve to all-null once executed. Callers must treat `false` as "unknown without
131+
/// compute". For a definitive answer, execute the validity with [`Self::execute_mask`] and
132+
/// check whether the resulting [`Mask`] is all-false (`Mask::all_false`). This is the
133+
/// all-null counterpart to [`Self::definitely_no_nulls`].
132134
#[inline]
133135
pub fn definitely_all_null(&self) -> bool {
134136
matches!(self, Self::AllInvalid)

0 commit comments

Comments
 (0)