nastra commented on code in PR #7145:
URL: https://github.com/apache/iceberg/pull/7145#discussion_r1142382664


##########
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:
   I wouldn't expect it to happen either, but I think it's more correct to 
pass-through whatever the `report` was in the first place (rather than 
defaulting to an unknown impl). 



-- 
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]

Reply via email to