Skip to main content

Module validity

Module validity 

Source
Expand description

Validity: an optional, packed missing-value mask for nullable column variants (I64 / I32 / Bool).

volas.NA is one logical missing value, but each dtype stores it in its natural place: a float column uses NaN in-band (no mask), so only the integer and boolean variants carry a Validity. A Validity is None in the common dense case — every value present, zero allocation — and a packed Bitmap (1 bit per element, set = present) only once a missing value actually appears. This is the Arrow / pandas-nullable physical layout, kept behind a uniform is_valid interface so the rest of the library never sees the per-dtype storage difference.

Structs§

Bitmap
A packed validity mask: 1 bit per element, set = present (valid), clear = missing (volas.NA). Bits are stored LSB-first in u64 words; bits beyond len are kept clear so a popcount over every word counts exactly the present values.
Validity
An optional validity mask. None (the dense default) means every value is present with no allocation; Some carries a Bitmap with at least one missing value. The invariant “Some ⇒ has a missing value” is upheld by the constructors so equality and has_nulls stay cheap and canonical.