This is an automated email from the ASF dual-hosted git repository.
dianfu pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.11 by this push:
new 782e76b [hotfix][python][docs] Improve the documentation about Python
dependency management
782e76b is described below
commit 782e76b1168c02887b94390eefcfa84515ff4e9d
Author: Dian Fu <[email protected]>
AuthorDate: Thu Jan 7 13:50:48 2021 +0800
[hotfix][python][docs] Improve the documentation about Python dependency
management
---
docs/dev/python/table-api-users-guide/dependency_management.md | 9 +++++----
.../dev/python/table-api-users-guide/dependency_management.zh.md | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/docs/dev/python/table-api-users-guide/dependency_management.md
b/docs/dev/python/table-api-users-guide/dependency_management.md
index cd2ec21..e3362ad 100644
--- a/docs/dev/python/table-api-users-guide/dependency_management.md
+++ b/docs/dev/python/table-api-users-guide/dependency_management.md
@@ -68,7 +68,7 @@ echo numpy==1.16.5 > requirements.txt
pip download -d cached_dir -r requirements.txt --no-binary :all:
# python code
-table_env.set_python_requirements("requirements.txt", "cached_dir")
+table_env.set_python_requirements("/path/to/requirements.txt", "cached_dir")
{% endhighlight %}
<p>Please make sure the installation packages matches the platform of
the cluster and the python version used. These packages will be installed using
pip, so also make sure the version of Pip (version >= 7.1.0) and the version of
SetupTools (version >= 37.0.0).</p>
</td>
@@ -83,9 +83,9 @@ table_env.set_python_requirements("requirements.txt",
"cached_dir")
zip -r py_env.zip py_env
# python code
-table_env.add_python_archive("py_env.zip")
+table_env.add_python_archive("/path/to/py_env.zip")
# or
-table_env.add_python_archive("py_env.zip", "myenv")
+table_env.add_python_archive("/path/to/py_env.zip", "myenv")
# the files contained in the archive file can be accessed in UDF
def my_udf():
@@ -100,9 +100,10 @@ def my_udf():
<td>
<p>Sets the path of the python interpreter which is used to execute
the python udf workers, e.g., "/usr/local/bin/python3".</p>
{% highlight python %}
-table_env.add_python_archive("py_env.zip")
+table_env.add_python_archive("/path/to/py_env.zip")
table_env.get_config().set_python_executable("py_env.zip/py_env/bin/python")
{% endhighlight %}
+ <p>Please note that if the path of the python interpreter comes from
the uploaded python archive, the path specified in set_python_executable should
be a relative path.</p>
<p>Please make sure that the specified environment matches the
platform that the cluster is running on.</p>
</td>
</tr>
diff --git a/docs/dev/python/table-api-users-guide/dependency_management.zh.md
b/docs/dev/python/table-api-users-guide/dependency_management.zh.md
index 61197b9..cf79c05 100644
--- a/docs/dev/python/table-api-users-guide/dependency_management.zh.md
+++ b/docs/dev/python/table-api-users-guide/dependency_management.zh.md
@@ -68,7 +68,7 @@ echo numpy==1.16.5 > requirements.txt
pip download -d cached_dir -r requirements.txt --no-binary :all:
# python code
-table_env.set_python_requirements("requirements.txt", "cached_dir")
+table_env.set_python_requirements("/path/to/requirements.txt", "cached_dir")
{% endhighlight %}
<p>Please make sure the installation packages matches the platform of
the cluster and the python version used. These packages will be installed using
pip, so also make sure the version of Pip (version >= 7.1.0) and the version of
SetupTools (version >= 37.0.0).</p>
</td>
@@ -83,9 +83,9 @@ table_env.set_python_requirements("requirements.txt",
"cached_dir")
zip -r py_env.zip py_env
# python code
-table_env.add_python_archive("py_env.zip")
+table_env.add_python_archive("/path/to/py_env.zip")
# or
-table_env.add_python_archive("py_env.zip", "myenv")
+table_env.add_python_archive("/path/to/py_env.zip", "myenv")
# the files contained in the archive file can be accessed in UDF
def my_udf():
@@ -100,9 +100,10 @@ def my_udf():
<td>
<p>Sets the path of the python interpreter which is used to execute
the python udf workers, e.g., "/usr/local/bin/python3".</p>
{% highlight python %}
-table_env.add_python_archive("py_env.zip")
+table_env.add_python_archive("/path/to/py_env.zip")
table_env.get_config().set_python_executable("py_env.zip/py_env/bin/python")
{% endhighlight %}
+ <p>Please note that if the path of the python interpreter comes from
the uploaded python archive, the path specified in set_python_executable should
be a relative path.</p>
<p>Please make sure that the specified environment matches the
platform that the cluster is running on.</p>
</td>
</tr>