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


##########
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:
   Is this for cases where an unknown metrics report is passed by a user rather 
than by Iceberg? I guess that makes sense, but I wouldn't expect it to happen.



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