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_r293397000
##########
File path:
flink-ml-parent/flink-ml-api/src/main/java/org/apache/flink/ml/api/misc/param/Params.java
##########
@@ -114,38 +171,104 @@ public Params clone() {
* @return a json containing all parameters in this Params
*/
public String toJson() {
- ObjectMapper mapper = new ObjectMapper();
- Map<String, String> stringMap = new HashMap<>();
try {
- for (Map.Entry<String, Object> e : paramMap.entrySet())
{
- stringMap.put(e.getKey(),
mapper.writeValueAsString(e.getValue()));
- }
- return mapper.writeValueAsString(stringMap);
+ return mapper.writeValueAsString(params);
Review comment:
I suppose you have forgotten to call `assertMapperInited` before
----------------------------------------------------------------
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