nastra commented on code in PR #7145:
URL: https://github.com/apache/iceberg/pull/7145#discussion_r1141846504
##########
core/src/main/java/org/apache/iceberg/rest/requests/ReportMetricsRequest.java:
##########
@@ -54,16 +55,20 @@ default void validate() {
}
static ReportMetricsRequest of(MetricsReport report) {
- ReportType reportType = null;
+ ReportType reportType = ReportType.UNKNOWN;
if (report instanceof ScanReport) {
reportType = ReportType.SCAN_REPORT;
} else if (report instanceof CommitReport) {
reportType = ReportType.COMMIT_REPORT;
}
- Preconditions.checkArgument(
- null != reportType, "Unsupported report type: %s",
report.getClass().getName());
-
return
ImmutableReportMetricsRequest.builder().reportType(reportType).report(report).build();
Review Comment:
we don't fallback to returning `ReportMetricsRequest unknown()` because
should prefer the `report` that was passed in to this method in L57
--
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]