lindong28 commented on code in PR #181:
URL: https://github.com/apache/flink-ml/pull/181#discussion_r1034447969
##########
flink-ml-python/pyflink/ml/lib/feature/tests/test_kbinsdiscretizer.py:
##########
@@ -163,7 +166,15 @@ def test_get_model_data(self):
expected_field_names = ['binEdges']
self.assertEqual(expected_field_names,
model_data.get_schema().get_field_names())
- # TODO: Add test to collect and verify the model data results after
FLINK-30122 is resolved.
+ model_rows = [result for result in
+
self.t_env.to_data_stream(model_data).execute_and_collect()]
+ self.assertEqual(1, len(model_rows))
+ bin_edges = model_rows[0][expected_field_names.index('binEdges')]
+ self.assertEqual(3, len(bin_edges))
+ self.assertListEqual([1, 5, 9, 13], bin_edges[0])
+ Double = get_gateway().jvm.java.lang.Double
Review Comment:
Can we avoid using get_gateway() here?
Typically python tests should mimic how users can interact with Flink ML
python API. It seems weird that users need to interpret output based on
get_gateway().
--
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]