We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ce08ed commit 9f10dfaCopy full SHA for 9f10dfa
1 file changed
vortex-array/src/scalar/convert/primitive.rs
@@ -64,8 +64,14 @@ macro_rules! primitive_scalar {
64
type Error = VortexError;
65
66
fn try_from(value: &Scalar) -> VortexResult<Self> {
67
- <Option<$T>>::try_from(value)?
68
- .ok_or_else(|| vortex_err!("Can't extract present value from null scalar"))
+ match value.value() {
+ Some(ScalarValue::Primitive(pv)) => pv.cast::<$T>(),
69
+ Some(_) => Err(vortex_err!(
70
+ "Expected primitive scalar, found {}",
71
+ value.dtype()
72
+ )),
73
+ None => Err(vortex_err!("Can't extract present value from null scalar")),
74
+ }
75
}
76
77
0 commit comments