gabotechs commented on code in PR #16195:
URL: https://github.com/apache/datafusion/pull/16195#discussion_r2120632856
##########
datafusion/physical-plan/src/metrics/value.rs:
##########
@@ -443,6 +528,9 @@ impl MetricValue {
.and_then(|ts| ts.timestamp_nanos_opt())
.map(|nanos| nanos as usize)
.unwrap_or(0),
+ Self::Custom { name, value } => {
+ value.as_usize().unwrap_or_else(||
panic!("MetricValue::as_usize isn't supported for custom metric values.
({name}: {value:?})"))
Review Comment:
Usually panicking is avoided as much as possible, but it seems like it's not
the only place where this can happen, and I have no better alternative without
changing several function signatures. I think it's acceptable, but I'd weight
other contributors opinion on this if any.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]