davidradl commented on code in PR #26667:
URL: https://github.com/apache/flink/pull/26667#discussion_r2177596568
##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/ml/TaskType.java:
##########
@@ -48,10 +51,31 @@ public static TaskType fromName(String name) {
return Arrays.stream(values())
.filter(taskType -> taskType.name.equals(name))
.findFirst()
- .orElseThrow(() -> new IllegalArgumentException("Unknown task
type: " + name));
+ .orElseThrow(() -> new ValidationException("Unknown task type:
" + name + "."));
}
public static boolean isValidTaskType(String name) {
return Arrays.stream(values()).anyMatch(taskType ->
taskType.name.equals(name));
}
+
+ public static Optional<RuntimeException> throwOrReturnInvalidTaskType(
Review Comment:
I think it would make more sense to call this method validateTaskType.
--
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]