Skip to content

Commit 907e83a

Browse files
branczclaude
andcommitted
fix: accept FixedSizeList dtype when deserializing ListValue scalars
Scalar serialization writes ScalarValue::Tuple as a protobuf ListValue regardless of whether the dtype is List or FixedSizeList, but list_from_proto only accepted List. Since #8667 made constant detection unconditional in the cascading compressor, a constant FixedSizeList column (e.g. a UUID stored as fixed_size_list(u8)[16]) is written as a ConstantArray whose scalar metadata then fails to deserialize on read: expected List dtype for ListValue, got fixed_size_list(u8)[16] Scalar validation already handles FixedSizeList + Tuple (including the size check), so deserialization was the only gap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Frederic Branczyk <fbranczyk@gmail.com>
1 parent c7c28d8 commit 907e83a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

vortex-array/src/scalar/proto.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,13 @@ fn list_from_proto(
441441
dtype: &DType,
442442
session: &VortexSession,
443443
) -> VortexResult<ScalarValue> {
444-
let element_dtype = dtype
445-
.as_list_element_opt()
446-
.ok_or_else(|| vortex_err!(Serde: "expected List dtype for ListValue, got {dtype}"))?;
444+
let element_dtype = match dtype {
445+
DType::List(edt, _) => edt,
446+
DType::FixedSizeList(edt, _, _) => edt,
447+
_ => {
448+
vortex_bail!(Serde: "expected List or FixedSizeList dtype for ListValue, got {dtype}")
449+
}
450+
};
447451

448452
let mut values = Vec::with_capacity(v.values.len());
449453
for elem in v.values.iter() {

0 commit comments

Comments
 (0)