walterddr commented on a change in pull request #11420:
[FLINK-16565][python][ml] Make Pipeline Json compitable between Java and Python
if all PipelineStages are Java ones
URL: https://github.com/apache/flink/pull/11420#discussion_r393797883
##########
File path: flink-python/pyflink/ml/tests/test_pipeline_it_case.py
##########
@@ -169,3 +169,39 @@ def test_pipeline(self):
# the first input is false since 0 + 0 is smaller than the max_sum 14.
# the second input is true since 12 + 3 is bigger than the max_sum 14.
self.assert_equals(actual, ["false", "true"])
+
+ def test_pipeline_from_and_to_java_json(self):
+
+ def get_java_pipeline_json():
+ wrapper = WrapperTransformer(selected_cols=["a", "b"])
+ wrapper._convert_params_to_java(wrapper._j_obj)
+ j_pipeline =
get_gateway().jvm.org.apache.flink.ml.api.core.Pipeline()
+ j_pipeline.appendStage(wrapper._j_obj)
+ return j_pipeline.toJson()
Review comment:
this piece of code replicates most of the logic in `Pipeline.to_json()`
except for the hard-coded pipeline stage "select_cols". was wondering if
there's a better way of making the test, e.g. use a json string literal here?
----------------------------------------------------------------
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