@@ -89,9 +89,7 @@ impl PyMetric {
8989 match ts. value ( ) {
9090 Some ( dt) => {
9191 let nanos = dt. timestamp_nanos_opt ( ) . ok_or_else ( || {
92- PyErr :: new :: < pyo3:: exceptions:: PyOverflowError , _ > (
93- "timestamp out of range" ,
94- )
92+ PyErr :: new :: < pyo3:: exceptions:: PyOverflowError , _ > ( "timestamp out of range" )
9593 } ) ?;
9694 let datetime_mod = py. import ( "datetime" ) ?;
9795 let datetime_cls = datetime_mod. getattr ( "datetime" ) ?;
@@ -126,8 +124,12 @@ impl PyMetric {
126124 MetricValue :: SpilledBytes ( c) => Ok ( Some ( c. value ( ) . into_pyobject ( py) ?. into_any ( ) ) ) ,
127125 MetricValue :: SpilledRows ( c) => Ok ( Some ( c. value ( ) . into_pyobject ( py) ?. into_any ( ) ) ) ,
128126 MetricValue :: CurrentMemoryUsage ( g) => Ok ( Some ( g. value ( ) . into_pyobject ( py) ?. into_any ( ) ) ) ,
129- MetricValue :: Count { count, .. } => Ok ( Some ( count. value ( ) . into_pyobject ( py) ?. into_any ( ) ) ) ,
130- MetricValue :: Gauge { gauge, .. } => Ok ( Some ( gauge. value ( ) . into_pyobject ( py) ?. into_any ( ) ) ) ,
127+ MetricValue :: Count { count, .. } => {
128+ Ok ( Some ( count. value ( ) . into_pyobject ( py) ?. into_any ( ) ) )
129+ }
130+ MetricValue :: Gauge { gauge, .. } => {
131+ Ok ( Some ( gauge. value ( ) . into_pyobject ( py) ?. into_any ( ) ) )
132+ }
131133 MetricValue :: Time { time, .. } => Ok ( Some ( time. value ( ) . into_pyobject ( py) ?. into_any ( ) ) ) ,
132134 MetricValue :: StartTimestamp ( ts) | MetricValue :: EndTimestamp ( ts) => {
133135 Self :: timestamp_to_pyobject ( py, ts)
0 commit comments