File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11use vortex_dtype:: DType ;
2- use vortex_error:: { VortexError , vortex_panic} ;
2+ use vortex_error:: { VortexError , VortexExpect , vortex_panic} ;
33use vortex_scalar:: { Scalar , ScalarValue } ;
44
55use super :: { Precision , Stat , StatType } ;
@@ -20,7 +20,10 @@ impl<S> StatsProviderExt for S where S: StatsProvider {}
2020
2121pub trait StatsProviderExt : StatsProvider {
2222 fn get_scalar ( & self , stat : Stat , dtype : & DType ) -> Option < Precision < Scalar > > {
23- self . get ( stat) . map ( |v| v. into_scalar ( dtype. clone ( ) ) )
23+ let stat_dtype = stat
24+ . dtype ( dtype)
25+ . vortex_expect ( "getting scalar for stat dtype" ) ;
26+ self . get ( stat) . map ( |v| v. into_scalar ( stat_dtype) )
2427 }
2528
2629 fn get_scalar_bound < S : StatType < Scalar > > ( & self , dtype : & DType ) -> Option < S :: Bound > {
You can’t perform that action at this time.
0 commit comments