You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/11/15 14:28:44 UTC

[GitHub] [flink-ml] gaoyunhaii commented on a change in pull request #35: [FLINK-24354][FLIP-174] Updates WithParams::set(...) to throw Exception if the given param is not defined on this instance

gaoyunhaii commented on a change in pull request #35:
URL: https://github.com/apache/flink-ml/pull/35#discussion_r749376404



##########
File path: flink-ml-api/src/main/java/org/apache/flink/ml/param/WithParams.java
##########
@@ -72,6 +72,14 @@
      */
     @SuppressWarnings("unchecked")
     default <V> T set(Param<V> param, V value) {
+        if (!getParamMap().containsKey(param)) {

Review comment:
       Is the `set()` method consistent with the `get()`?
   
   I'm asking because it seems in `get()` we only throws exception when `if (value == null && !param.validator.validate(value))`, is it as expected or it might be `||` instead of `&&` ? 




-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org