ex00 commented on a change in pull request #8632: [FLINK-12744][ml] add shared
params in ml package
URL: https://github.com/apache/flink/pull/8632#discussion_r294888177
##########
File path:
flink-ml-parent/flink-ml-api/src/main/java/org/apache/flink/ml/api/misc/param/Params.java
##########
@@ -69,20 +133,11 @@
* evaluated as illegal by the validator
*/
public <V> Params set(ParamInfo<V> info, V value) {
- if (!info.isOptional() && value == null) {
- throw new RuntimeException(
- "Setting " + info.getName() + " as null while
it's not a optional param");
- }
- if (value == null) {
- remove(info);
- return this;
- }
-
if (info.getValidator() != null &&
!info.getValidator().validate(value)) {
throw new RuntimeException(
"Setting " + info.getName() + " as a invalid
value:" + value);
}
- paramMap.put(info.getName(), value);
+ params.put(info.getName(), valueToJson(value));
Review comment:
thanks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services