Fix for null handling #15788 (#15857)

Fixes #15788 

# Description
Fixes null handling. Thanks to @MMesch for reporting and taking a first
stab at fixing.

Co-authored-by: Jack Wright <jack.wright@nike.com>
This commit is contained in:
Jack Wright 2025-05-30 15:38:46 -07:00 committed by GitHub
parent 8b9f02246f
commit 2f74574e35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -792,15 +792,11 @@ fn series_to_values(
) -> Result<Vec<Value>, ShellError> { ) -> Result<Vec<Value>, ShellError> {
match series.dtype() { match series.dtype() {
DataType::Null => { DataType::Null => {
let it = std::iter::repeat(Value::nothing(span)); if let Some(size) = maybe_size {
let values = if let Some(size) = maybe_size { Ok(vec![Value::nothing(span); size])
Either::Left(it.take(size))
} else { } else {
Either::Right(it) Ok(vec![Value::nothing(span); series.len()])
} }
.collect::<Vec<Value>>();
Ok(values)
} }
DataType::UInt8 => { DataType::UInt8 => {
let casted = series.u8().map_err(|e| ShellError::GenericError { let casted = series.u8().map_err(|e| ShellError::GenericError {