dianfu commented on a change in pull request #10017: [FLINK-14019][python] add 
support for managing environment and dependencies of Python UDF in Flink Python 
API
URL: https://github.com/apache/flink/pull/10017#discussion_r348506288
 
 

 ##########
 File path: flink-python/pyflink/table/table_environment.py
 ##########
 @@ -715,6 +718,111 @@ def create_temporary_view(self, view_path, table):
         """
         self._j_tenv.createTemporaryView(view_path, table._j_table)
 
+    def add_python_file(self, file_path):
+        """
+        Upload single python file, python package or local directory to 
cluster.
+        These files and directory will append to the PYTHONPATH variable of 
python UDF worker.
+        Please make sure they can be imported directly.
+
+        If python UDFs used in job depend on additional files, this method 
should be called to
+        upload them to cluster.
+
+        :param file_path: The path of python file, python package or local 
directory.
+        :type file_path: str
+        """
+        self._dependency_manager.add_python_file(file_path)
+
+    def set_python_requirements(self, requirements_file_path, 
requirements_cache_dir=None):
+        """
+        Upload a "requirements.txt" file to specify the third-party libraries 
used in python UDF.
+        These libraries will be installed to a temporary directory and be 
imported to the python
+        UDF worker.
+
+        If python UDFs used in job depend on third-party libraries, this 
method should be called
+        to transmit them to cluster.
+
+        If the cluster is running on a private network that cannot access the 
PyPI central
+        repository, a local directory contains all packages listed in the 
"requirements.txt" file
 
 Review comment:
   "a local directory contains" -> "a local directory which contains"

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

Reply via email to