@@ -27,55 +27,52 @@ pub(crate) fn stats_set_to_df(
2727 // TODO(connor): There's a lot that can go wrong here, should probably handle this
2828 // more gracefully...
2929 // Find the min statistic.
30- let min = stats_set. get ( Stat :: Min ) . and_then ( |pstat_val| {
31- pstat_val
32- . map ( |stat_val| {
33- Scalar :: try_new (
34- Stat :: Min
35- . dtype ( dtype)
36- . vortex_expect ( "must have a valid dtype" ) ,
37- Some ( stat_val) ,
38- )
39- . vortex_expect ( "`Stat::Min` somehow had an incompatible `DType`" )
40- . try_to_df ( )
41- . ok ( )
42- } )
43- . transpose ( )
44- } ) ;
30+ let min = stats_set
31+ . get ( Stat :: Min )
32+ . map ( |stat_val| {
33+ Scalar :: try_new (
34+ Stat :: Min
35+ . dtype ( dtype)
36+ . vortex_expect ( "must have a valid dtype" ) ,
37+ Some ( stat_val) ,
38+ )
39+ . vortex_expect ( "`Stat::Min` somehow had an incompatible `DType`" )
40+ . try_to_df ( )
41+ . ok ( )
42+ } )
43+ . transpose ( ) ;
4544
4645 // Find the max statistic.
47- let max = stats_set. get ( Stat :: Max ) . and_then ( |pstat_val| {
48- pstat_val
49- . map ( |stat_val| {
50- Scalar :: try_new (
51- Stat :: Max
52- . dtype ( dtype)
53- . vortex_expect ( "must have a valid dtype" ) ,
54- Some ( stat_val) ,
55- )
56- . vortex_expect ( "`Stat::Max` somehow had an incompatible `DType`" )
57- . try_to_df ( )
58- . ok ( )
59- } )
60- . transpose ( )
61- } ) ;
46+ let max = stats_set
47+ . get ( Stat :: Max )
48+ . map ( |stat_val| {
49+ Scalar :: try_new (
50+ Stat :: Max
51+ . dtype ( dtype)
52+ . vortex_expect ( "must have a valid dtype" ) ,
53+ Some ( stat_val) ,
54+ )
55+ . vortex_expect ( "`Stat::Max` somehow had an incompatible `DType`" )
56+ . try_to_df ( )
57+ . ok ( )
58+ } )
59+ . transpose ( ) ;
6260
6361 // Find the sum statistic
64- let sum = stats_set. get ( Stat :: Sum ) . and_then ( |pstat_val| {
65- pstat_val
66- . map ( |stat_val| {
67- Scalar :: try_new (
68- Stat :: Sum
69- . dtype ( dtype)
70- . vortex_expect ( "must have a valid dtype" ) ,
71- Some ( stat_val) ,
72- )
73- . vortex_expect ( "`Stat::Sum` somehow had an incompatible `DType`" )
74- . try_to_df ( )
75- . ok ( )
76- } )
77- . transpose ( )
78- } ) ;
62+ let sum = stats_set
63+ . get ( Stat :: Sum )
64+ . map ( |stat_val| {
65+ Scalar :: try_new (
66+ Stat :: Sum
67+ . dtype ( dtype)
68+ . vortex_expect ( "must have a valid dtype" ) ,
69+ Some ( stat_val) ,
70+ )
71+ . vortex_expect ( "`Stat::Sum` somehow had an incompatible `DType`" )
72+ . try_to_df ( )
73+ . ok ( )
74+ } )
75+ . transpose ( ) ;
7976
8077 let null_count = stats_set. get_as :: < usize > ( Stat :: NullCount , & PType :: U64 . into ( ) ) ;
8178
@@ -92,9 +89,9 @@ pub(crate) fn stats_set_to_df(
9289}
9390
9491pub ( crate ) fn is_constant_to_distinct_count (
95- is_constant : Option < VortexPrecision < bool > > ,
92+ is_constant : VortexPrecision < bool > ,
9693) -> Precision < usize > {
97- match is_constant. and_then ( VortexPrecision :: as_exact) {
94+ match is_constant. as_exact ( ) {
9895 Some ( true ) => Precision :: Exact ( 1 ) ,
9996 Some ( false ) | None => Precision :: Absent ,
10097 }
0 commit comments