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_r348493845
 
 

 ##########
 File path: flink-python/bin/pyflink-udf-runner.sh
 ##########
 @@ -23,9 +23,22 @@ if [[ "$FLINK_TESTING" = "1" ]]; then
     FLINK_SOURCE_ROOT_DIR=`cd $ACTUAL_FLINK_HOME/../../../../../; pwd`
     FLINK_PYTHON="${FLINK_SOURCE_ROOT_DIR}/flink-python"
     if [[ ! -f "${FLINK_PYTHON}/pyflink/fn_execution/boot.py" ]]; then
-      # use pyflink source code to override the pyflink.zip in PYTHONPATH
-      # to ensure loading latest code
-      export PYTHONPATH="$FLINK_PYTHON:$PYTHONPATH"
+        # use pyflink source code to override the pyflink.zip in PYTHONPATH
+        # to ensure loading latest code
+        export PYTHONPATH="$FLINK_PYTHON:$PYTHONPATH"
+    fi
+fi
+
+if [[ "$python" = "" ]]; then
+    python="python"
+fi
+
+if [[ "$_PYTHON_WORKING_DIR" != "" ]]; then
+    cd "$_PYTHON_WORKING_DIR"
+    if [[ "$python" == ${_PYTHON_WORKING_DIR}* ]]; then
+        # The file extracted from archives may not preserve its original 
permission.
+        # Append minimum execution permission to prevent from permission 
denied error.
 
 Review comment:
   Append -> Set?

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