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 2022/11/23 12:16:45 UTC

[GitHub] [flink-ml] yunfengzhou-hub opened a new pull request, #181: [FLINK-30124] Support collecting model data with arrays and maps

yunfengzhou-hub opened a new pull request, #181:
URL: https://github.com/apache/flink-ml/pull/181

   <!--
   *Thank you very much for contributing to Apache Flink ML - we are happy that you want to help us improve Flink ML. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to one [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] Title of the pull request`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   *(For example: This pull request adds the implementation of Naive Bayes algorithm.)*
   
   ## Brief change log
   
   *(for example:)*
     - *Adds Transformer and Estimator implementation of Naive Bayes in Java and Python*
     - *Adds examples and documentations of Naive Bayes*
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


-- 
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


[GitHub] [flink-ml] lindong28 commented on pull request #181: [FLINK-30124] Support collecting model data with arrays and maps

Posted by GitBox <gi...@apache.org>.
lindong28 commented on PR #181:
URL: https://github.com/apache/flink-ml/pull/181#issuecomment-1326578575

   Thanks for the PR! LGTM overall. Left one minor comment.


-- 
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


[GitHub] [flink-ml] lindong28 commented on a diff in pull request #181: [FLINK-30124] Support collecting model data with arrays and maps

Posted by GitBox <gi...@apache.org>.
lindong28 commented on code in PR #181:
URL: https://github.com/apache/flink-ml/pull/181#discussion_r1031617400


##########
flink-ml-python/pom.xml:
##########
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>flink-ml-parent</artifactId>
+        <groupId>org.apache.flink</groupId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>flink-ml-python</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-python_2.12</artifactId>
+            <version>${flink.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-common</artifactId>
+            <version>${flink.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-core</artifactId>
+            <version>1.15.1</version>

Review Comment:
   Should we use `${flink.version}` 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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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


[GitHub] [flink-ml] lindong28 commented on pull request #181: [FLINK-30124] Support collecting model data with arrays and maps

Posted by GitBox <gi...@apache.org>.
lindong28 commented on PR #181:
URL: https://github.com/apache/flink-ml/pull/181#issuecomment-1330320243

   Thanks for the update. LGTM.


-- 
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


[GitHub] [flink-ml] lindong28 merged pull request #181: [FLINK-30124] Support collecting model data with arrays and maps

Posted by GitBox <gi...@apache.org>.
lindong28 merged PR #181:
URL: https://github.com/apache/flink-ml/pull/181


-- 
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


[GitHub] [flink-ml] lindong28 commented on a diff in pull request #181: [FLINK-30124] Support collecting model data with arrays and maps

Posted by GitBox <gi...@apache.org>.
lindong28 commented on code in PR #181:
URL: https://github.com/apache/flink-ml/pull/181#discussion_r1034363906


##########
flink-ml-python/pyflink/ml/tests/test_utils.py:
##########
@@ -51,15 +51,17 @@ def setUp(self):
         self.t_env = StreamTableEnvironment.create(self.env)
         self.temp_dir = tempfile.mkdtemp()
 
-        RelMetadataQueryBase = get_gateway().jvm.\
-            org.apache.calcite.rel.metadata.RelMetadataQueryBase
-        JaninoRelMetadataProvider = get_gateway().jvm.\
-            org.apache.calcite.rel.metadata.JaninoRelMetadataProvider
-        FlinkDefaultRelMetadataProvider = get_gateway().jvm.\
-            org.apache.flink.table.planner.plan.metadata.FlinkDefaultRelMetadataProvider
-
-        RelMetadataQueryBase.THREAD_PROVIDERS \
-            .set(JaninoRelMetadataProvider.of(FlinkDefaultRelMetadataProvider.INSTANCE()))
+        get_gateway().jvm.org.apache.flink.ml.python.PythonTestUtils.initializeRelMetaDataProvider()
+
+        # RelMetadataQueryBase = get_gateway().jvm.\

Review Comment:
   Can you rebase this PR and check if we still need these changes?



-- 
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


[GitHub] [flink-ml] lindong28 commented on a diff in pull request #181: [FLINK-30124] Support collecting model data with arrays and maps

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

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